Help With setting limit
#1

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;
            }
Reply
#2

Use strlen: https://sampwiki.blast.hk/wiki/Strlen
Reply
#3

i thought same but ? how in this case and knstantinos there is an huge problem i hope u can solve it
Reply
#4

Код:
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;
            }
Reply
#5

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)