Help With setting limit - 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: Help With setting limit (
/showthread.php?tid=516073)
Help With setting limit -
AroseKhanNiazi - 29.05.2014
how can i return a message on player enter more than 30 words pass or less then 10
pawn Код:
if(inputtext > 30)
{
SCM(playerid,COLOR_RED,"Please Enter An Password less than 30 words/numbers.");
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"{02FBD6}Login","{FFFFFF}This account is already {02FBD6}registered{FFFFFF} - Please {02FBD6}login{FFFFFF}.\nIf this is not your {E30544}account{FFFFFF}, then quit and change your nick\nin {E30544}SA-MP {FFFFFF}browser.\n{E30544}Invalid password!","Login","Quit");
return 1;
}
if(inputtext < 10)
{
SCM(playerid,COLOR_RED,"Please Enter An Password Longer Than 10 words/numbers.");
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"{02FBD6}Login","{FFFFFF}This account is already {02FBD6}registered{FFFFFF} - Please {02FBD6}login{FFFFFF}.\nIf this is not your {E30544}account{FFFFFF}, then quit and change your nick\nin {E30544}SA-MP {FFFFFF}browser.\n{E30544}Invalid password!","Login","Quit");
return 1;
}
Re: Help With setting limit -
Konstantinos - 29.05.2014
Use strlen:
https://sampwiki.blast.hk/wiki/Strlen
Re: Help With setting limit -
AroseKhanNiazi - 29.05.2014
i thought same but ? how in this case and knstantinos there is an huge problem i hope u can solve it
Re: Help With setting limit -
Rittik - 29.05.2014
Код:
if(strlen(inputtext) > 30)
{
SCM(playerid,COLOR_RED,"Please Enter An Password less than 30 words/numbers.");
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"{02FBD6}Login","{FFFFFF}This account is already {02FBD6}registered{FFFFFF} - Please {02FBD6}login{FFFFFF}.\nIf this is not your {E30544}account{FFFFFF}, then quit and change your nick\nin {E30544}SA-MP {FFFFFF}browser.\n{E30544}Invalid password!","Login","Quit");
return 1;
}
if(strlen(inputtext) < 10)
{
SCM(playerid,COLOR_RED,"Please Enter An Password Longer Than 10 words/numbers.");
ShowPlayerDialog(playerid,dlogin,DIALOG_STYLE_PASSWORD,"{02FBD6}Login","{FFFFFF}This account is already {02FBD6}registered{FFFFFF} - Please {02FBD6}login{FFFFFF}.\nIf this is not your {E30544}account{FFFFFF}, then quit and change your nick\nin {E30544}SA-MP {FFFFFF}browser.\n{E30544}Invalid password!","Login","Quit");
return 1;
}
Re: Help With setting limit -
AroseKhanNiazi - 29.05.2014
thanks