Hi,
After i fixed my previous problem now i have this! Read carefully, When i have to register my password got saved for sure all fine example (mypassword123), but when i came to login and type example (123) which isn't not my password i got message "The password you entered is incorrect" BUT I am logged in and i can counitnue with gaming :| I'm really confused right now! All help with be appricated +REP if helped!
After i fixed my previous problem now i have this! Read carefully, When i have to register my password got saved for sure all fine example (mypassword123), but when i came to login and type example (123) which isn't not my password i got message "The password you entered is incorrect" BUT I am logged in and i can counitnue with gaming :| I'm really confused right now! All help with be appricated +REP if helped!
Code:
if( response )
{
new string1[30], hashpass[129];
WP_Hash(hashpass,sizeof(hashpass),inputtext);
if(!strcmp(hashpass, PlayerInfo[playerid][PASSWORD], false))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][MONEY]);
SetPVarInt(playerid, "gLogged", 1);
SendClientMessage(playerid, -1, "SERVER: You have successfully logged!");
}
else
{
if(GetPVarInt(playerid, "FailedLoginAttempt") == 0)
{
SetPVarInt(playerid, "FailedLoginAttempt", 1);
SendClientMessage(playerid, -1, "SERVER: The password you have entered is incorrect (1/3 attempts used).");
}
else if(GetPVarInt(playerid, "FailedLoginAttempt") == 1)
{
SetPVarInt(playerid, "FailedLoginAttempt", 2);
SendClientMessage(playerid, -1, "SERVER: The password you have entered is incorrect (2/3 attempts used).");
}
else if(GetPVarInt(playerid, "FailedLoginAttempt") == 2)
{
SetPVarInt(playerid, "FailedLoginAttempt", 3);
SendClientMessage(playerid, -1, "SERVER: The password you have entered is incorrect (3/3 attempts used).");
}
else if(GetPVarInt(playerid, "FailedLoginAttempt") == 3)
{
DeletePVar(playerid, "FailedLoginAttempt");
SendClientMessage(playerid, -1, "SERVER: You have used up all your login attempts, and hence got kicked.");
Kick(playerid);
}
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", string1, "Login", "Cancel");
}
}
}
}
return 1;
}