[Help]MySQL changepass cmd
#1

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
Код 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;
}
If you need something else, tell me.
Reply


Messages In This Thread
[Help]MySQL changepass cmd - by Banditul18 - 22.09.2016, 11:47
Re: [Help]MySQL changepass cmd - by Konstantinos - 22.09.2016, 11:50
Re: [Help]MySQL changepass cmd - by Banditul18 - 22.09.2016, 12:36
Re: [Help]MySQL changepass cmd - by Konstantinos - 22.09.2016, 12:39
Re: [Help]MySQL changepass cmd - by Vince - 22.09.2016, 14:27
Re: [Help]MySQL changepass cmd - by Banditul18 - 22.09.2016, 15:10

Forum Jump:


Users browsing this thread: 1 Guest(s)