Password verifacation issue - 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 verifacation issue (
/showthread.php?tid=543709)
Password verifacation issue -
thecurtehs - 28.10.2014
Hello. I took the Vortex Roleplay script and tried to make the passwords use the WP_HASH thing so that it stored the password as a has and not its actual characters.
I added it for /changepass, and it worked. So now when you /changepass, and relog you can log in with your changed password. But when I tried adding it to the registration case, it didn't work. The password I sign up with doesn't actually work when I try logging back in.
Here is the code:
Код:
case 3894:
{
if(strlen(inputtext) > 128 || strlen(inputtext) < 1)
{
new buf[129];
WP_Hash(buf, sizeof(buf), inputtext);
format(Player[playerid][Password], 255, "%s", buf);
new Sum, string[128];
Sum = 3-Player[playerid][LoginAttempts];
SendClientMessage(playerid, ADMINORANGE, "The password you have entered does not match your account. Please try again or use the forums.");
Player[playerid][LoginAttempts]++;
format(string, sizeof(string), "You have %d remaining login attempts, before you are auto-banned.", Sum);
SendClientMessage(playerid, WHITE, string);
ShowPlayerDialog(playerid, 3894, DIALOG_STYLE_PASSWORD, "Authentication", "Welcome to Inner City Roleplay\n\nYou have an account, please enter your password to authenticate.", "Login", "Help");
}
else
{
if(Player[playerid][Authenticated] == 0)
{
OnPlayerLoginAttempt(playerid, inputtext);
}
else
{
SendClientMessage(playerid, GREY, "You're already authenticated.");
}
}
}
Re: Password verifacation issue -
TakeiT - 28.10.2014
You're missing a line that checks if the password entered = the player's password.
If you compare yours to the original, you should be able to find it.
Re: Password verifacation issue -
thecurtehs - 28.10.2014
You may have been right, but I fixed it anyway. Somehow...