Error with inputtext
#1

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")
Reply
#2

Why not make the dialog a list, and then set their sex/gender per listitem...Will be easier for you and the players
Reply
#3

EH yeah thanks
Reply
#4

No problem, if you need anything else, just PM me anytime.
Reply
#5

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
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)