10.02.2014, 12:11
Hello everyone
I have to give player 3 login tries but this code is working for only 1 try after 1 try if you enter wrong password then the player will get kicked.
I have to give player 3 login tries but this code is working for only 1 try after 1 try if you enter wrong password then the player will get kicked.
Код:
if ((GetPVarInt(playerid, "LoginTries") + 3) <= 3)
{
SetPVarInt(playerid, "LoginTries", GetPVarInt(playerid, "LoginTries") + 1);
SendClientMessage(playerid, -1, "Incorrect password. Please try again (you have 3 tries left).");
DisplayDialogForPlayer(playerid, 1);
}
else if ((GetPVarInt(playerid, "LoginTries") + 2) <= 2)
{
SetPVarInt(playerid, "LoginTries", GetPVarInt(playerid, "LoginTries") + 1);
SendClientMessage(playerid, -1, "Incorrect password. Please try again (you have 2 tries left).");
DisplayDialogForPlayer(playerid, 1);
}
else if ((GetPVarInt(playerid, "LoginTries") + 1) <= 1)
{
SetPVarInt(playerid, "LoginTries", GetPVarInt(playerid, "LoginTries") + 1);
SendClientMessage(playerid, -1, "Incorrect password. Please try again (you have 1 tries left).");
DisplayDialogForPlayer(playerid, 1);
}
else
{
SendClientMessage(playerid, LIGHTRED, "You have entered an incorrect password too many times. You have been kicked.");
Kick(playerid);
}
return 1;


