17.10.2014, 06:35
At the top of your script add:
Inside OnPlayerConnect in first lines, add this:
Now the code you used:
Also use [pawn] tags for codes, for easier reading.
Hope I helped ^^
pawn Код:
new LoginAttempts[MAX_PLAYERS];
pawn Код:
LoginAttempts[playerid] = 0;
pawn Код:
if(strcmp(buf, PlayerInfo[playerid][pPass], false) != 0)
{
SendClientMessage(playerid, RED, "Incorrect password.");
if(LoginAttempts[playerid] == 3)
{
format(string, sizeof(string), "%s [%d] has been kicked from CCNR - Reason: Incorrect password", GetName(playerid), playerid);
SendClientMessage(playerid, RED, string);
Kick(playerid);
}
else
{
LoginAttempts[playerid]++;
// Create the same dialog box here again.
}
return 1;
}
Hope I helped ^^