Changepass command help - 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: Changepass command help (
/showthread.php?tid=659446)
Changepass command help -
GameOvr - 03.10.2018
I changed my hashing method from udb_hash to whirlpool but now it giving me many errors in game
Код:
CMD:changepass (playerid, params[])
{
new oldpass[128], newpass[128], name[MAX_PLAYER_NAME];
if(sscanf(params, "s[20]s[20]", oldpass, newpass)) return SendClientMessage(playerid, COLOR_USAGE, "* USAGE:/changepass [oldpassword] [newpassword]");
new buf1[129], buf[129];
WP_Hash(buf, sizeof(buf), oldpass);
if(strcmp(buf, USERINFO[playerid][pPass], false) == 1) return SendClientMessage(playerid, COLOR_ERROR, "Incorrect password");
if(strlen(newpass) < 5 ) return SendClientMessage(playerid, COLOR_ERROR, "Your new password must include atleast 5 characters");
if(strlen(newpass) > 20 ) return SendClientMessage(playerid, COLOR_ERROR, "Your new password cannot go over 20 characters");
WP_Hash(buf1, sizeof(buf1), newpass);
USERINFO[playerid][pPass] = buf1;
SendClientMessage(playerid, COLOR_SUCCESSFUL, "Your password has been changed successfully");
new str[128];
format(str, sizeof(str), "Your new password: %s", newpass);
SendClientMessage(playerid, -1, str);
return 1;
}
even I put a wrong pass as my old pass there, it accepts that as the correct pass
plz tell me what is wrong there
Re: Changepass command help -
SaMuRy - 03.10.2018
Might be work, you checked if "pPass" has been changed on the script?