16.07.2013, 22:15
Hello, how to make an password lengh that you must type minimal 1 letter as password? Give me an short example or something like that, please.
if(strlen(inputtext) <= 1 )
{
//Do Something
}
PHP код:
|
if(strlen(inputtext) >= 1)
{
// Code
}
stock IsLetter(c)
{
return ((c >= 65 && c <= 91) || (c >= 97 && c <= 123)) ? true : false;
}
// Under on OnDialogResponse
new bool:valid = false;
for(new i = 0; i < strlen(inputtext); i++)
{
if(IsLetter(inputtext[i]))
{
valid = true;
break;
}
}
if(valid)
{
// Success code
}
else
{
SendClientMessage(playerid, COLOR, "Your password must contain at least one character");
}
if(strlen(inputtext) < 1) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Register","{80999B}You have entered an invalid password.\nYour password must contain more than one characters.\nType your password below to register a new account.","Register","Quit");