27.05.2014, 05:56
i am using whirlpool to hass passes and everything is fine(even it saves the hassed pass in .ini) but now problem comes with login stuff, even if players input incorrect pass, he still logs in but he dosent get the stats, here is what i am using.
update : he gets the stats if he insert correct pass
update : he gets the stats if he insert correct pass
pawn Код:
enum pInfo
{
Pass[129]
}
new PlayerInfo[MAX_PLAYERS][pInfo];
public loadaccount_user(playerid, name[], value[])
{
INI_String("Password", PlayerInfo[playerid][Pass],129);
return 1;
}
//on dialog response
if(dialogid == DIALOG_LOGIN)
{
if(!response) return Kick(playerid); //
if(response) //
{//
new hashpass[129]; //
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(!strcmp(hashpass,PlayerInfo[playerid][Pass]))
{//then
INI_ParseFile(UserPath(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
SetPlayerScore(playerid,PlayerInfo[playerid][Score]);//
GivePlayerMoney(playerid,PlayerInfo[playerid][Cash]);
SendClientMessage(playerid,-1,"Welcome back! You have successfully logged in");//
}
else //
{//
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");//We will tell to them that they've entered an incorrect password
return 1;
}
}
return 1;
}