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: 2,813
Reputation: 1358
Default OnPlayerText problem

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??
__________________
  • Need a script done? (for cash) - Check here
  • Want to follow my progress of making a detailed KITT replica? (last update 7/Aug/14) - Click me
Jstylezzz is online now   Reply With Quote
Old 08/07/2012, 10:44 PM   #2
Vince
Godfather
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 8,180
Reputation: 2021
Default Re: OnPlayerText problem

Strcmp returns 0 on success.
__________________

[Tutorial] Database normalization: Part 1 - Part 2
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: 885
Reputation: 55
Default Re: OnPlayerText problem

replace
Code:
return 1;
with
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,439
Reputation: 596
Default Re: OnPlayerText problem

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: 2,813
Reputation: 1358
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
__________________
  • Need a script done? (for cash) - Check here
  • Want to follow my progress of making a detailed KITT replica? (last update 7/Aug/14) - Click me
Jstylezzz is online now   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: 885
Reputation: 55
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 10:09 PM.


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