SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/07/2012, 10:32 PM   #1
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: the Netherlands
Posts: 1,744
Reputation: 903
Default OnPlayerText problem

Hi everyone,

I have this code, but when i type anything, it returns all...
pawn Code:
if(IsCallingATaxi[playerid] == 1)
    {
    if(strcmp(text, "yes", true, strlen(text)))
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Cellphone: Okay then, a taxi is coming your way soon, please wait patiently till your call is accepted!");
    return 1;
    }
    if(strcmp(text, "no", true, strlen(text)))
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Cellphone: okay then, have a good day!");
    HangUpPhone(playerid);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Cellphone: Excuse me? Yes or no?");
    return 1;
    }
    }

anyone sees the problem??
__________________
Tired of all those power hungry roleplay servers nowadays, running one of those annoying edits? I'm working on a script completely from scratch! This isn't just a "roleplay" server, this is "life simulation", at least that's the concept.
The server will be based in Palomino Creek. If you're interested and want to help us to get the forum going, why not register and join the conversation? We're also more than happy to accept suggestions from anyone. Hope to see you soon!
  • Want to follow my progress of making a detailed KITT replica? (last update 7/Aug/14) - Click
  • Living in the Countryside forum - Click me
  • Need a script done? Go here (Scripts for release on this forum are free!)
Jstylezzz is offline   Reply With Quote
Old 08/07/2012, 10:44 PM   #2
Vince
Godfather
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 6,786
Reputation: 1782
Default Re: OnPlayerText problem

Strcmp returns 0 on success.
__________________

I am not your "bro", not your "nigga" and not your friend.
Vince is offline   Reply With Quote
Old 08/07/2012, 10:46 PM   #3
SnG.Scot_MisCuDI
Gangsta
 
SnG.Scot_MisCuDI's Avatar
 
Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 839
Reputation: 43
Default Re: OnPlayerText problem

replace
pawn Code:
return 1;
with
pawn Code:
return 0;
__________________

aka Googamalugafoo
Forum || Beta Server

SnG.Scot_MisCuDI is offline   Reply With Quote
Old 08/07/2012, 10:46 PM   #4
FireCat
Banned
 
Join Date: Jul 2010
Posts: 2,470
Reputation: 596
Default Re: OnPlayerText problem

pawn Code:
if(IsCallingATaxi[playerid] == 1)
    {
    if(!strcmp(text, "yes", true, strlen(text)))
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Cellphone: Okay then, a taxi is coming your way soon, please wait patiently till your call is accepted!");
    return 1;
    }
    if(!strcmp(text, "no", true, strlen(text)))
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Cellphone: okay then, have a good day!");
    HangUpPhone(playerid);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_LIGHTBLUE,"Cellphone: Excuse me? Yes or no?");
    return 1;
    }
    }
FireCat is offline   Reply With Quote
Old 08/07/2012, 11:03 PM   #5
Jstylezzz
High-roller
 
Jstylezzz's Avatar
 
Join Date: Sep 2011
Location: the Netherlands
Posts: 1,744
Reputation: 903
Default Re: OnPlayerText problem

thanks both, i will try now

EDIT: now it's working, but my text is orange and goes to all players....
EDIT2: NVM problem fixed, thanks both
__________________
Tired of all those power hungry roleplay servers nowadays, running one of those annoying edits? I'm working on a script completely from scratch! This isn't just a "roleplay" server, this is "life simulation", at least that's the concept.
The server will be based in Palomino Creek. If you're interested and want to help us to get the forum going, why not register and join the conversation? We're also more than happy to accept suggestions from anyone. Hope to see you soon!
  • Want to follow my progress of making a detailed KITT replica? (last update 7/Aug/14) - Click
  • Living in the Countryside forum - Click me
  • Need a script done? Go here (Scripts for release on this forum are free!)
Jstylezzz is offline   Reply With Quote
Old 08/07/2012, 11:16 PM   #6
SnG.Scot_MisCuDI
Gangsta
 
SnG.Scot_MisCuDI's Avatar
 
Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 839
Reputation: 43
Default Re: OnPlayerText problem

Refer to this for future:
http://wiki.sa-mp.com/wiki/Strcmp
__________________

aka Googamalugafoo
Forum || Beta Server

SnG.Scot_MisCuDI is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnPlayerText Problem [D]ry[D]esert Scripting Help 6 15/05/2012 02:26 PM
OnPlayerText problem. BGMike Scripting Help 10 07/11/2011 04:56 PM
OnPlayerText - problem. Mmartin Help Archive 4 11/03/2011 10:41 AM
OnPlayerText problem billiout Help Archive 10 29/07/2010 06:54 PM
Problem with OnPlayerText leapfish Help Archive 4 20/02/2010 12:58 PM


All times are GMT. The time now is 04:52 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.