Hidden password - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Hidden password (
/showthread.php?tid=144815)
Hidden password -
Mikep. - 29.04.2010
I have a plugin to send emails to my users. An email is sent when they register, and it shows their password.
Say my password was 'password', i'd like it to say
p******d
Just showing the first and last letters.
What's the simplest way to do this? Create a new string, extract the first and last character, then strins() the strlen of their password-2?
Re: Hidden password -
Joe Staff - 29.04.2010
Here's my whack at it.
pawn Код:
//input = what they typed for pass
new pass[MAX_PASSWORD]="**********************";
format(pass,MAX_PASSWORD,"%s%s%s",input[0],pass[strlen(pass)-strlen(input)+2],input[strlen(input)-1]);
print(pass);
Re: Hidden password -
Mikep. - 29.04.2010
It didn't work, but I edited it a bit and got it to work.
pawn Код:
new pass[21]="********************";
new first[2];
strmid(first, input, 0, 1);
format(pass,24,"%s%s%s",first,pass[(22-strlen(input))],input[strlen(input)-1]);
print(pass);
Thank you for starting me off
Re: Hidden password -
Joe Staff - 29.04.2010
eh yeah, I shoulda put "%c%s%s" instead of "%s%s%s"
Re: Hidden password -
eixas10 - 29.04.2010
How to install