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,703
Reputation: 830
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??
__________________
Inactive for a week, on vacation

Tired of all those power hungry roleplay servers nowadays, running one of those annoying edits? I'm working on a roleplay script completely from scratch, and am setting up a very good and mature staff team. The server will be based in Palomino Creek. It's set to be a small server, until the max playable capacity of the town is reached. 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!
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,506
Reputation: 1694
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.
The average intellect of the average SA-MP forums user.
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: 810
Reputation: 42
Default Re: OnPlayerText problem

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

aka Googamalugafoo

SnG.Scot_MisCuDI is offline   Reply With Quote
Old 08/07/2012, 10:46 PM   #4
FireCat
Banned
 
Join Date: Jul 2010
Posts: 2,471
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,703
Reputation: 830
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
__________________
Inactive for a week, on vacation

Tired of all those power hungry roleplay servers nowadays, running one of those annoying edits? I'm working on a roleplay script completely from scratch, and am setting up a very good and mature staff team. The server will be based in Palomino Creek. It's set to be a small server, until the max playable capacity of the town is reached. 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!
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: 810
Reputation: 42
Default Re: OnPlayerText problem

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

aka Googamalugafoo

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 08:27 AM.


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