[HELP] OnRconLoginAttempt - 3 Chances
#6

Quote:
Originally Posted by Jeffry
Посмотреть сообщение
Sorry, but I guess this one is the best way:

At TOP:
pawn Код:
new RCONAttempts[MAX_PLAYERS];
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success)
    {
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                new pIP[16]; GetPlayerIP(playerid, pIP, 16);
                if(!strcmp(ip, pIP))
                {
                    RCONAttempts[i]++;
                    if(RCONAttempts[i]>=3)
                    {
                        SendClientMessage(i, 0xF0F0FFF, "Wrong Password. Good Bye!");
                        Ban(i);
                        RCONAttempts[i]=0;
                    }
                }
            }
        }
    }
    return 1;
}
And add at OnPlayerConnect:
pawn Код:
RCONAttempts[playerid]=0;

You need to reset the tries when the ID connects.

Tell me if there is any bug.


Jeffry
That's exactly what I said?
Reply


Messages In This Thread
[HELP] OnRconLoginAttempt - 3 Chances - by Larsey123IsMe - 28.12.2010, 14:13
Re: [HELP] OnRconLoginAttempt - 3 Chances - by _rAped - 28.12.2010, 14:16
Re: [HELP] OnRconLoginAttempt - 3 Chances - by MadeMan - 28.12.2010, 14:22
Re: [HELP] OnRconLoginAttempt - 3 Chances - by _rAped - 28.12.2010, 14:34
Re: [HELP] OnRconLoginAttempt - 3 Chances - by Jeffry - 28.12.2010, 15:11
Re: [HELP] OnRconLoginAttempt - 3 Chances - by _rAped - 28.12.2010, 15:12
Re: [HELP] OnRconLoginAttempt - 3 Chances - by Jeffry - 28.12.2010, 15:59
Re: [HELP] OnRconLoginAttempt - 3 Chances - by _rAped - 28.12.2010, 16:05
Re: [HELP] OnRconLoginAttempt - 3 Chances - by Jochemd - 28.12.2010, 16:26

Forum Jump:


Users browsing this thread: 1 Guest(s)