Rcon protection
#2

Accomplishable with minimal modifcations of the example on the SA-MP wiki:
Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(!success) //If the password was incorrect
    {
        printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
        new pip[16];
        for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
        {
            GetPlayerIp(i, pip, sizeof(pip));
            if(!strcmp(ip, pip, true) && !PlayerInfo[i][pAdmin]) //If a player's IP is the IP that failed the login AND they aren't an admin
            {
                SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
                Ban(i); //They are now banned.
            }
        }
    }
    return 1;
}
Of course you'll need to replace '!PlayerInfo[i][pAdmin])' with the variable that matches your script/admin system.

I'd HIGHLY advise you use foreach instead if you use that, and if you don't use it, what are you waiting for?
Reply


Messages In This Thread
Rcon protection - by NexySamp - 04.07.2015, 11:47
Re: Rcon protection - by rymax99 - 04.07.2015, 11:56
Re: Rcon protection - by nezo2001 - 04.07.2015, 11:59
Re: Rcon protection - by yeehao98 - 04.07.2015, 11:59
Re: Rcon protection - by NexySamp - 04.07.2015, 12:23
Re: Rcon protection - by rymax99 - 04.07.2015, 12:30
Re: Rcon protection - by NexySamp - 04.07.2015, 13:27
Re: Rcon protection - by Sime30 - 04.07.2015, 13:34
Re: Rcon protection - by NexySamp - 04.07.2015, 13:47
Re: Rcon protection - by Sime30 - 04.07.2015, 14:01

Forum Jump:


Users browsing this thread: 1 Guest(s)