Dialog Inputtext
#2

Put this at the bottom of your script
pawn Код:
stock IsValidPassword(const password[])
{
    for(new i = 0; password[i] != EOS; ++i)
    {
        switch(password[i])
        {
            case '0'..'9', 'A'..'Z', 'a'..'z': continue;
            default: return 0;
        }
    }
    return 1;
}
Put this under your register dialog (under your if(response) of u have one):
pawn Код:
if(!IsValidPassword(inputtext))
            {
                SendClientMessage(playerid, -1, ""COL_RED"The password is invalid, Valid characters are: A-Z, a-z, 0-9");
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, ""COL_BLUE"SGZM"COL_WHITE" Register pannel", "Please register to play on "COL_BLUE"Survival Games Zombie Mode\n"COL_WHITE"Enter a "COL_BLUE"password"COL_WHITE":", "Register", "Exit");
                return 1;
            }
            if(strlen(inputtext) < 3 || strlen(inputtext) > 24)
            {
                SendClientMessage(playerid, -1, ""COL_RED"The password is invalid, Its lenght should be 3-24 characters");
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, ""COL_BLUE"SGZM"COL_WHITE" Register pannel", "Please register to play on "COL_BLUE"Survival Games Zombie Mode\n"COL_WHITE"Enter a "COL_BLUE"password"COL_WHITE":", "Register", "Exit");
                return 1;
            }
You will need to change the color defines to yours.
goodluck!
Reply


Messages In This Thread
Dialog Inputtext - by Day_Jons - 19.11.2013, 08:07
Re: Dialog Inputtext - by Voxel - 19.11.2013, 08:36

Forum Jump:


Users browsing this thread: 3 Guest(s)