04.05.2011, 12:59
Hi i've modified Zh3ro command /changepass from his script for my and i've got a problem.. a problem is i'm hashing a player password with Whirpool when player register.
It's sending me a "SendClientMessage(playerid, COLOR_RED, "* Hasło, ktуre wpisałeś nie pasuje do aktualnego.");" it mean i've entered a bad password to change. I need to get hashed password but don't know how to do that and hash a new one. Anyone please?
pawn Код:
CMD:changepass(playerid, params[])
{
new NewPass[129], OldPass[129];
if(sscanf(params, "s[129]s[129]", OldPass, NewPass))return SendClientMessage(playerid, COLOR_WHITE, "* Wpisz: /changepass [OLD] [NEW]");
INI_ParseFile(PlayerFile(playerid), "GetPlayerPassword", false, true, playerid);
new Password[129];
GetPVarString(playerid, "pPass", Password, 129);
if(strcmp(Password, OldPass, false) != 0)return SendClientMessage(playerid, COLOR_RED, "* Hasło, ktуre wpisałeś nie pasuje do aktualnego.");
if(strlen(NewPass) < 5 || strlen(NewPass) > 20)return SendClientMessage(playerid, COLOR_RED, "* Hasło nie może być krуtsze niż pięć znakуw, ani dłuższe niż 20.");
SendFormattedMessage(playerid, COLOR_GREEN, "* Zmieniłeś stare hasło na nowe: %s", NewPass);
new INI:Account = INI_Open(PlayerFile(playerid));
INI_WriteString(Account, "Old_Password", OldPass);
INI_WriteString(Account, "Password", NewPass);
INI_Close(Account);
return true;
}