19.11.2013, 08:36
Put this at the bottom of your script
Put this under your register dialog (under your if(response) of u have one):
You will need to change the color defines to yours.
goodluck!
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;
}
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;
}
goodluck!