SA-MP Forums Archive
Password Length - 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: Password Length (/showthread.php?tid=498569)



Password Length - Blackazur - 04.03.2014

Hello, how to make that the password must be between 5 and 32 characters?

Код:
   if(response)
            {
		if(!strlen(inputtext) || strlen(inputtext) > 32)
            }

	     else if(strlen(inputtext) > 0 && strlen(inputtext) < 32)
             {



Re: Password Length - [..MonTaNa..] - 04.03.2014

pawn Код:
if(strlen(inputtext) < 5)
            {
//Code
            return 1;
            }
            if(strlen(inputtext) > 32)
            {
//Code
            return 1;
            }



AW: Password Length - Blackazur - 04.03.2014

I dont think that this will work.


Re: Password Length - [..MonTaNa..] - 04.03.2014

Give it a try,
Example;

pawn Код:
if(strlen(inputtext) < 5)
            {
                ShowPlayerDialog(playerid, Your_Dialog, DIALOG_STYLE_INPUT, "Register", "The password must be more than 5 characters.", "Register", "Cancel");
                return 1;
            }
            if(strlen(inputtext) > 32)
            {
                ShowPlayerDialog(playerid, Your_Dialog, DIALOG_STYLE_INPUT, "Register", "The password is too long.", "Register", "Cancel");
                return 1;
            }



Re: Password Length - Ada32 - 04.03.2014

if(strlen(inputtext) < 5 || strlen(inputtext) > 32)


Respuesta: Password Length - Thewin - 04.03.2014

if(response)
{
if(strlen(inputtext) < 5 || strlen(inputtext) > 32) //error
return 1;
}

else if(strlen(inputtext) > 4 && strlen(inputtext) < 33) //accepted
return 1;
{


Re: Respuesta: Password Length - Ada32 - 04.03.2014

Quote:
Originally Posted by Thewin
Посмотреть сообщение
if(response)
{
if(strlen(inputtext) < 5 || strlen(inputtext) > 32) //error
return 1;
}

else if(strlen(inputtext) > 4 && strlen(inputtext) < 33) //accepted
return 1;
{
or just else..


Re: Password Length - SuperViper - 04.03.2014

pawn Код:
if(5 > strlen(inputtext) > 32)
{
    // password not between 5-32 characters
}



Re: Password Length - Konstantinos - 04.03.2014

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
if(5 > strlen(inputtext) > 32)
{
    // password not between 5-32 characters
}
That will not work. It should be:
pawn Код:
if (!(5 <= strlen(inputtext) <= 32))
{
    // password not between 5-32 characters
}



Re: Password Length - Nurgle4 - 04.03.2014

pawn Код:
if(strlen(inputtext) < 5 || strlen(inputtext) > 32)
{
  //Code
}