01.11.2014, 14:24
Hey.
I've been trying to set up a changepass command, but after many attempts I still can't find a way to get it working.
I'm using BlueG's R7 MySQL plugin and Whirlpool hash.
Here's one failed changepass example I've tested;
With this code the password doesn't change at all and "You have successfully changed your password." doesn't appear.
Help is appreciated and rep will be given to helpers
I've been trying to set up a changepass command, but after many attempts I still can't find a way to get it working.
I'm using BlueG's R7 MySQL plugin and Whirlpool hash.
Here's one failed changepass example I've tested;
pawn Код:
CMD:changepass(playerid, params[])
{
if (gPlayerInfo[playerid][pLogged] == 0)
return SendClientMessage( playerid, -1, "You need to be logged in to use this. " );
if( isnull( params ) )
return SendClientMessage( playerid, -1, "USAGE: /changepass [New password]. " );
new query[128];
mysql_function_query(gHandle, query, true, "ChangePass", "d", playerid);
return 1;
}
forward ChangePass(playerid);
public ChangePass(playerid)
{
new query[128];
format(query, sizeof(query), "UPDATE `users` SET `pass`='%s' WHERE `id`='%d'", gPlayerInfo[playerid][pPass], gPlayerInfo[playerid][pID]);
SendClientMessage(playerid, -1, "You have successfully changed your password.");
return 1;
}
Help is appreciated and rep will be given to helpers