Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Changepassword

$
0
0
Hello, i have this command from my old gamemode, which players can be able to change password:

Code:

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.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>