06.03.2011, 15:57
Why is this not working? It have no Errors/Warnings, it just dont change the password.
pawn Код:
dcmd_changepass(playerid, params[])
{
new oldpass[128];
new queue[313], WPhash[145], escape[145];
if(sscanf(params, "s[128]s[128]", oldpass, WPhash)) return SendClientMessage(playerid, COLOR_USAGE, "USAGE: /changepass (Old Password) (New Password)");
//else if(oldpass == wrongpassword) return SendClientMessage(playerid, COLOR_ERROR, "Error: Wrong 'Old password'");
{
mysql_real_escape_string(oldpass, escape);
WP_Hash(WPhash, sizeof(WPhash), escape);
format(queue, sizeof(queue), "UPDATE `Players` SET `Password` = '%s' WHERE `Username` = '%s'", WPhash, PlayerIP(playerid));
mysql_query(queue);
SendClientMessage(playerid, COLOR_GREEN, "Password Changed!");
}
return 1;
}