Scripting Help
#3

At the top of your script add:
pawn Код:
new LoginAttempts[MAX_PLAYERS];
Inside OnPlayerConnect in first lines, add this:
pawn Код:
LoginAttempts[playerid] = 0;
Now the code you used:
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;
}
Also use [pawn] tags for codes, for easier reading.

Hope I helped ^^
Reply


Messages In This Thread
Scripting Help - by TheRandomManUK - 17.10.2014, 05:39
Re: Scripting Help - by TheRandomManUK - 17.10.2014, 06:25
Re: Scripting Help - by AnnaSB - 17.10.2014, 06:35

Forum Jump:


Users browsing this thread: 2 Guest(s)