07.05.2015, 08:08
I want to do this: when someone enters incorrect password, It sends him the remaining attempts of logging in otherwise he will get kick, but I tried to do that and it keeps saying: Incorrect Password! 3 Attempts Of Logging Left Before Being Kicked. it keeps saying 3 attempts, why it's not decreasing? whats the problem in this:
pawn Код:
else
{
LoginWarns[playerid] ++;
new warnmsg[128];
if(LoginWarns[playerid] < MAX_LOGINS)
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
format(warnmsg, sizeof(warnmsg), "Incorrect Password! %d Attempt(s) Of Logging Left Before Being Kicked!", MAX_LOGINS-LoginWarns[playerid]);
SendClientMessage(playerid, 0xFF0000AA, warnmsg);
return 1;
}
if(LoginWarns[playerid] == MAX_LOGINS)
{
LoginKickWithMessage(playerid, 0xFF0000AA, "You Have Failed In Logging In, You Have Been Kicked.");
LoginWarns[playerid] = 0;
return 1;
}
}
}
}