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,649
Reputation: 674
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??
__________________

TypeNameLink
[Music]Blackout - The band I play in Facebook
[Filterscript]jGarage - Dynamic GaragesThread
[Filterscript]jTaxi - A taxi systemThread
[Filterscript]MaploaderThread
[Tutorial]Updating your sa-mp server and scriptsThread
Contact
| Skype - jari1338 |
Working on West Side Roleplay
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,113
Reputation: 1627
Default Re: OnPlayerText problem

Strcmp returns 0 on success.
__________________
I will rarely post a ready made solution in your thread, but rather I try to make you realize your own mistakes so you can fix them yourself.
Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime.
Vince is online now   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: 800
Reputation: 42
Default Re: OnPlayerText problem

replace
pawn Code:
return 1;
with
pawn Code:
return 0;
__________________
We are Anonymous. We are Legion. We do not forgive. We do not forget. Expect us.

SnG.Scot_MisCuDI is offline   Reply With Quote
Old 08/07/2012, 10:46 PM   #4
FireCat
Banned
 
Join Date: Jul 2010
Posts: 2,472
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,649
Reputation: 674
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
__________________

TypeNameLink
[Music]Blackout - The band I play in Facebook
[Filterscript]jGarage - Dynamic GaragesThread
[Filterscript]jTaxi - A taxi systemThread
[Filterscript]MaploaderThread
[Tutorial]Updating your sa-mp server and scriptsThread
Contact
| Skype - jari1338 |
Working on West Side Roleplay
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: 800
Reputation: 42
Default Re: OnPlayerText problem

Refer to this for future:
http://wiki.sa-mp.com/wiki/Strcmp
__________________
We are Anonymous. We are Legion. We do not forgive. We do not forget. Expect us.

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 10:15 PM.


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