24.10.2013, 22:37
why this sends me that my old pass is incorrect even if it is correct ?
pawn Код:
CMD:changepass(playerid,params[])
{
new string[128], newpass;
new oldpass = PlayerInfo[playerid][pPass];
if(sscanf(params, "ss", oldpass, newpass)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFF00}[Usage:]: {FFFFFF}/changepass [old password] [new password]");
if(oldpass != PlayerInfo[playerid][pPass]) return SendClientMessage(playerid,COLOR_RED,"Error: Your old password is incorrect, please try again.");
if(newpass == PlayerInfo[playerid][pPass]) return SendClientMessage(playerid,COLOR_RED,"Error: Your new password is the current password.");
else
{
PlayerInfo[playerid][pPass] = newpass;
format(string, sizeof(string), "Your password is successfully changed to: %s", newpass);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}