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



Dialog problem - L.Hudson - 05.08.2012

when I put in the dialog an age that's allowed according to what I've set, it still shows invalid age

pawn Код:
if(dialogid == 2)
        {
            if(response)
            {
                new age = strlen(inputtext);
                if(age < 18 || age > 50)
                {
                    SCM(playerid, -1, "Invalid age.");
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Select your age","Invalid age\n Type your age to continue.","Set","Quit");
                    return 1;
                }
                else
                {
                    Player[playerid][Age] = age;
                    format(string, sizeof(string), "Your age is: -%d-",age);
                    SendClientMessage(playerid, COLOR_YELLOW, string);
                    RegStep[playerid] = 3;
                    return 1;
                }
            }
            else
            {
                SCM(playerid, -1, "You did not put your age. (Kicked)");
                Kick(playerid);
            }
        }