Error with inputtext - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Error with inputtext (
/showthread.php?tid=369326)
Error with inputtext -
Stefand - 16.08.2012
Hey,
This is for my Register system the Sex from the player,
pawn Код:
case 7000:
{
if(strlen(inputtext) != "Male" || strlen(inputtext) != "Female" || strlen(inputtext) != "Boy" || strlen(inputtext) != "Girl")
{
new string[128];
Player[playerid][Sex] = strval(inputtext);
format(string, sizeof(string), "So you are a %s.", strval(inputtext));
SCM(playerid, WHITE, string);
ShowPlayerDialog(playerid, 7001, DIALOG_STYLE_INPUT, "Registration -> Age", "{FFFFFF}Enter your Characters Age", "Enter", "");
}
else
{
SendClientMessage(playerid, WHITE, "Invalid Gender, Use: Male, Female, Boy, Girl");
ShowPlayerDialog(playerid, 7000, DIALOG_STYLE_INPUT, "Registration -> Sex", "{FFFFFF}Enter your Characters Sex", "Enter", "");
}
}
But it gives this error:
Код:
C:\Users\Stefan Dorst\Desktop\GTA SA\Abandoned Island RP\gamemodes\AIRP.pwn(2267) : error 001: expected token: "-string end-", but found "-identifier-"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
Error line: if(strlen(inputtext) != "Male" || strlen(inputtext) != "Female" || strlen(inputtext) != "Boy" || strlen(inputtext) != "Girl")
Re : Error with inputtext -
Sandiel - 16.08.2012
Why not make the dialog a list, and then set their sex/gender per listitem...Will be easier for you and the players
Re: Error with inputtext -
Stefand - 16.08.2012
EH yeah thanks
Re: Error with inputtext -
Sandiel - 16.08.2012
No problem, if you need anything else, just PM me anytime.
Re: Error with inputtext -
FalconX - 16.08.2012
Quote:
Originally Posted by Sandiel
No problem, if you need anything else, just PM me anytime.
|
pawn Код:
if( !strcmp( inputtext, "Male" ) || !strcmp( inputtext, "Female" ) || !strcmp( inputtext, "Boy" ) || !strcmp( inputtext, "Girl" ) )
{
//your code
}
else
{
// your code
}