31.12.2013, 12:39
Hello, how to make that you have 3 login attemps and if that fail you will be kicked?
#define MAX_TRY_TO_LOGIN 3
TryedLogin[playerid]++;// On login
if(TryedLogin[playerid] >= MAX_TRY_TO_LOGIN)
{
Kick(playerid);
}
new LoginAttempt[MAX_PLAYERS];//global variable.
//on your login system , when the player input wrong password
LoginAttempt[playerid] ++;
if(LoginAttempt[playerid] == 3) Kick(playerid);
// global:
new
Player_LoginAttempts[MAX_PLAYERS];
// OnPlayerConnect:
Player_LoginAttempts[playerid] = 0;
// When a player is trying to login:
if (++Player_LoginAttempts[playerid] >= 3)
{
// kick player for 3 or more wrong login attempts..
}
else
{
// inform the player that the password is wrong and let them try again..
}
//however your codes is , when the player enter the wrong password
LoginAttemp[playerid] ++;