19.04.2012, 12:15
Now great it compile but when i try in game
'/changepass 0913456373 iloveyou'
it says "That is not your oldpass!"
maybe this is because my saving system is hasing my password?
i use dudb to hash my password
pawn Код:
CMD:changepass(playerid, params[])
{
new newpass[50], oldpass[50];
format(oldpass, 50, "%s", pInfo[playerid][Pass]);
new INI:file = INI_Open(PlayerPath(playerid));
if(sscanf(params, "s[50]s[50]", oldpass, newpass)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX: /changepass [oldpass] [newpass]");
if(strval(pInfo[playerid][Pass]) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'oldpass' blank!");
if(strval(newpass) < 0) return SendClientMessage(playerid, COLOR_GREY, "Don't leave the line called 'newpass' blank!");
if(strcmp(oldpass, pInfo[playerid][Pass], true) != 0) return SendClientMessage(playerid, COLOR_GREY, "That is not your oldpassword!");
INI_WriteInt(file, "Pass", udb_hash(newpass));
INI_Close(file);
return 1;
}
it says "That is not your oldpass!"
maybe this is because my saving system is hasing my password?
i use dudb to hash my password