Dialog string check
#1

Hello,

I want to know what the player's gender is.
The way I do this is by Dialog.

Now, the problem is that I can't check if the inputtext is Male or Female.

My code:

pawn Code:
if(dialogid == 8)
    {
        if(response)
        {
         if(inputtext == "Male" || inputtext == "male") // Line 955
            {
                SendClientMessage(playerid, COLOR_GREEN, "So you are a Male.");
                gPlayerInfo[playerid][pSex] = 1;
            }
            else if(inputtext == "Female" || inputtext == "female") // Line 960
            {
                SendClientMessage(playerid, COLOR_GREEN, "So you are a Female.");
                gPlayerInfo[playerid][pSex] = 2;
            }
            else
            {
                SendClientMessage(playerid, COLOR_RED, "You need to choose between Male or Female!");
                ShowPlayerDialog(playerid, 8, DIALOG_STYLE_INPUT, "Sex", "What gender are you?\n\nMale / Female", "Ok", "Cancel");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You need to fill in what your gender is!");
            ShowPlayerDialog(playerid, 8, DIALOG_STYLE_INPUT, "Sex", "What gender are you?\n\nMale / Female", "Ok", "Cancel");
        }
    }
And the error I get is:

pawn Code:
D:\GTASAN~1\server\GAMEMO~1\RRP.pwn(955) : error 001: expected token: "-string end-", but found "-identifier-"
D:\GTASAN~1\server\GAMEMO~1\RRP.pwn(960) : error 001: expected token: "-string end-", but found "-identifier-"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
Thanks in advance!
Reply


Messages In This Thread
Dialog string check - by Hipflop - 09.07.2011, 17:10
Re: Dialog string check - by Cyanide - 09.07.2011, 17:13
Re: Dialog string check - by Hipflop - 09.07.2011, 17:16
Re: Dialog string check - by =WoR=Varth - 09.07.2011, 17:19
Re: Dialog string check - by Cyanide - 09.07.2011, 17:25
Re: Dialog string check - by Hipflop - 09.07.2011, 18:14

Forum Jump:


Users browsing this thread: 1 Guest(s)