I Need help for my Rcon
#7

the code that I wrote will ban anyone who tries to log in into rcon (INGAME). It will automatically ban you, except, if your ingame name is the name you used where I wrote "EnterYourNameHere". So you can enter your ingame name at that and will be able to login into rcon. Anyone else can't.. What you can also do is this:
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
    if(success)
    {
        new playerid = -1, cip[20];
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                GetPlayerIp(i, cip, sizeof(cip));
                if(!strcmp(ip, cip, true))
                {
                    playerid = i;
                    break;
                }
            }
        }
        if(playerid != -1)
        {
            new name[MAX_PLAYER_NAME];
            GetPlayerName(playerid, name, sizeof(name));
            if(strcmp(name, "EnterYourNameHere", true) != 0)
            {
                Ban(playerid);
            }
        }
    }
    return 1;
}
this will only ban the player, if he entered the correct player.

So short: This will automatically ban any player who does not have the name you enter in the "EnterYourNameHere" field.. Straight away, no warning, no question - just ban.
Reply


Messages In This Thread
I Need help for my Rcon - by boysockpr0123 - 18.03.2014, 14:21
Re: I Need help for my Rcon - by Parallex - 18.03.2014, 14:24
Re: I Need help for my Rcon - by Sascha - 18.03.2014, 14:30
Re: I Need help for my Rcon - by boysockpr0123 - 18.03.2014, 14:49
Re: I Need help for my Rcon - by Sascha - 18.03.2014, 15:04
Re: I Need help for my Rcon - by boysockpr0123 - 18.03.2014, 15:14
Re: I Need help for my Rcon - by Sascha - 18.03.2014, 15:28

Forum Jump:


Users browsing this thread: 1 Guest(s)