register with caracters and big letter register - 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: register with caracters and big letter register (
/showthread.php?tid=653095)
register with caracters and big letter register -
ShadowBlack - 26.04.2018
how i can when a player at dialog it's input password, check if the password have a number, a big letter and minim 6 characters
Re: register with caracters and big letter register -
AdamsLT - 26.04.2018
https://sampforum.blast.hk/showthread.php?tid=365818
This thread has some solutions you can look through.
Big letter - it is called uppercase (lowercase for small letters).
To find the length of the password, you can use the
https://sampwiki.blast.hk/wiki/Strlen function.
You could also try using a regex plugin and writing a pattern or searching for one online since there are lots of them available in places like stackoverflow.
Re: register with caracters and big letter register -
CodeStyle175 - 26.04.2018
PHP код:
CheckPw(password[]){
new cntNumbers,
cntBigLetters,
len=strlen(password);
if(len < 6)return 0;
for(new i; i < len; i++){
switch(password[i]){
case '0'..'9': cntNumbers++;
case 'A'..'Z': cntBigLetters++;
}
}
return (cntNumbers>=3 && cntBigLetters>=3);
}
Re: register with caracters and big letter register -
ShadowBlack - 26.04.2018
thank you.