Changepassword - 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: Changepassword (
/showthread.php?tid=632835)
Changepassword -
Despacito - 20.04.2017
Hello, i have this command from my old gamemode, which players can be able to change password:
pawn Код:
CMD:changepass(playerid, params[])
{
if(PlayerInfo[playerid][pLogged] == 1)
{
new pass[30];
if(sscanf(params,"s[30]", pass)) return SendClientMessage(playerid, RED,"[USAGE]: /changepass [new password]");
new query[200];
format(query, sizeof(query),"UPDATE `playerdata` SET `password`=SHA1('%s') WHERE `user`='%s'", pass, escpname(playerid));
mysql_query(query);
mysql_free_result();
new str[120];
format(str, sizeof(str),"Your password has been successfully changed to "cred"%s", pass);
SendClientMessage(playerid, GREEN,str);
}
else
{
SendClientMessage(playerid, RED, "ERROR: You must login in order to change your password");
}
return 1;
}
Since in the new gamemode im not using SHA1 anymore but SHA256, how should i edit it to make it work with new hashing system? Thanks.
Re: Changepassword -
DobbysGamertag - 20.04.2017
Can you at least update to a newer mysql plugin?
However:
pawn Код:
UPDATE `playerdata` SET `password`=SHA2('%s',256) WHERE `user`='%s' LIMIT 1