SA-MP Forums Archive
Dialog->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: Dialog->inputtext (/showthread.php?tid=595580)



Dialog->inputtext - Luicy. - 04.12.2015

Hello,
I would need help with the inputtext in a "if",
Before you comments: Search it!!!
Don't do it, I already did.

Full script: http://pastebin.com/7wPhTJPt
Dialog script:
pawn Код:
case Dialog_Register_Gender:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, Dialog_Register_Password, DIALOG_STYLE_INPUT, ""Dialog_Color_LightBlue"Los Angeles Deathless Roleplay.","Welcome to Los Angeles Deathless RolePlay!\n\nContine by writing your characters Gender below.\n"Dialog_Color_Red"Sadly didn't you enter a gender!","Contine","Quit");
                if(inputtext == "Female")
                {
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteString(File,"Gender","F");
                    INI_Close(File);
                    ShowPlayerDialog(playerid, Dialog_Register_Gender, DIALOG_STYLE_INPUT,""Dialog_Color_LightBlue"Los Angeles Deathless Roleplay.","Welcome to Los Angeles Deathless RolePlay!\n\nContine by writing your characters Gender below.\n(Female/Male)","Register","Quit");
                }
                else if(inputtext == "female")
                {
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteString(File,"Gender","F");
                    INI_Close(File);
                }
                else if(inputtext == "f")
                {
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteString(File,"Gender","F");
                    INI_Close(File);
                }
                else if(inputtext == "Male")
                {
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteString(File,"Gender","M");
                    INI_Close(File);
                }
                else if(inputtext == "male")
                {
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteString(File,"Gender","M");
                    INI_Close(File);
                }
                else if(inputtext == "m")
                {
                    new INI:File = INI_Open(UserPath(playerid));
                    INI_SetTag(File,"data");
                    INI_WriteString(File,"Gender","M");
                    INI_Close(File);
                }
                else
                {
                    ShowPlayerDialog(playerid, Dialog_Register_Password, DIALOG_STYLE_INPUT, ""Dialog_Color_LightBlue"Los Angeles Deathless Roleplay.","Welcome to Los Angeles Deathless RolePlay!\n\nContine by writing your characters Gender below.\n"Dialog_Color_Red"Sadly didn't you enter a gender!","Contine","Quit");
                }
            }
        }



Re: Dialog->inputtext - Luicy. - 04.12.2015

Solved
Solution:
PHP код:
if(!strcmp(inputtext"Female")) 
instead of
PHP код:
if(inputtext == "Female"