![]() |
#1 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2011
Location: the Netherlands
Posts: 2,967
Reputation: 1545
|
![]()
Hi everyone,
I have this code, but when i type anything, it returns all... 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?? |
![]() |
![]() |
![]() |
#2 |
Spam Machine
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Sep 2007
Location: Belgium
Posts: 11,006
Reputation: 2647
|
![]()
Strcmp returns 0 on success.
|
![]() |
![]() |
![]() |
#3 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 897
Reputation: 56
|
![]()
replace
Code:
return 1; Code:
return 0; |
![]() |
![]() |
![]() |
#4 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Jul 2010
Posts: 2,402
Reputation: 596
|
![]() 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; } } |
![]() |
![]() |
![]() |
#5 |
High-roller
![]() ![]() ![]() ![]() ![]() Join Date: Sep 2011
Location: the Netherlands
Posts: 2,967
Reputation: 1545
|
![]()
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 ![]() |
![]() |
![]() |
![]() |
#6 |
Gangsta
![]() ![]() ![]() ![]() Join Date: Mar 2011
Location: Gilbert, Arizona
Posts: 897
Reputation: 56
|
![]()
Refer to this for future:
http://wiki.sa-mp.com/wiki/Strcmp |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
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 03:56 PM |
OnPlayerText - problem. | Mmartin | Help Archive | 4 | 11/03/2011 09:41 AM |
OnPlayerText problem | billiout | Help Archive | 10 | 29/07/2010 06:54 PM |
Problem with OnPlayerText | leapfish | Help Archive | 4 | 20/02/2010 11:58 AM |