22.09.2016, 11:47
I tried to make a /changepass cmd around 1 h, but i don't understand why is not working. MySQL version is r41.
The old password is doesn't change, it stay same. So when i change the password the querry is working but is doesn't change the password
If you need something else, tell me.
The old password is doesn't change, it stay same. So when i change the password the querry is working but is doesn't change the password
Код HTML:
CMD:changepass(playerid, params[]) { new newpass[65], query[221], string[64]; if(Player[playerid][IsLoggedIn] == false) return 0; if(sscanf(params, "s[65]", newpass)) return SendClientMessage(playerid, -1, "Use: /changepass [new password]"); format(string, sizeof string, "You chnage your password to %s", newpass); SendClientMessage(playerid, -1, string); for (new i = 0; i < 16; i++) Player[playerid][Salt][i] = random(94) + 33; SHA256_PassHash(newpass, Player[playerid][Salt], Player[playerid][Password], 65); mysql_format(g_SQL, query, sizeof query, "UPDATE `players` SET `password`= %s,`salt`= %e WHERE `id` = %d LIMIT 1", Player[playerid][Password], Player[playerid][Salt], Player[playerid][ID]); mysql_tquery(g_SQL, query); print(query); return 1; }