20.02.2015, 17:36
hi guys i make a cmd for player change his password it change in mysql database but the proble is
when i change my pass it doesn't check if the old pass if correct plz help
sorry for my bad english
best regards
when i change my pass it doesn't check if the old pass if correct plz help
pawn Код:
CMD:changepass(playerid,params[])
{
new oldpass[128];
new query[313], name[24], WPhash[145], escape[145];
if(sscanf(params, "s[128]s[128]", oldpass, WPhash)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /changepass (Old Password) (New Password)");
//else if(oldpass == wrongpassword) return SendClientMessage(playerid, COLOR_ERROR, "Error: Wrong 'Old password'");
{
GetPlayerName(playerid,name,24);
mysql_real_escape_string(oldpass, escape);
WP_Hash(WPhash, sizeof(WPhash), escape);
mysql_format(mysql, query, sizeof(query), "UPDATE `Players` SET `Password` = '%s' WHERE `Username` = '%s'", WPhash, name);
mysql_query(mysql, query,"", "");
SendClientMessage(playerid, COLOR_GREEN, "Password Changed!");
}
return 1;
}
best regards