How to ban an IP from your server?
#1

Title says it..

And when you send the Rcon command to reload bans, does it get rid of all the bans or just the IP you chose to unban?
Reply
#2

Just IP that you unbanned/banned. Example: /rcon banip 127.0.0.1 /rcon reloadbans.
Reply
#3

So would you send the RconCommand BanIP?
Reply
#4

Here's an example:

pawn Код:
CMD:banip(playerid, params[])
{
    new
        iStr[32],
        IP[16]
    ;
    if(sscanf(params, "s[24]", IP)) return SendClientMessage(playerid, -1, "Usage: /banip [IP]");
    format(iStr, sizeof(iStr),"banip %s", IP);
    SendRconCommand(iStr);
    SendRconCommand("reloadbans");
    return 1;
}
Reply
#5

Ah okay.. And then if you was to unban an IP it'd be:
pawn Код:
CMD:unbanip(playerid, params[])
{
    new
        iStr[32],
        IP[16]
    ;
    if(sscanf(params, "s[24]", IP)) return SendClientMessage(playerid, -1, "Usage: /unbanip [IP]");
    format(iStr, sizeof(iStr),"unbanip %s", IP);
    SendRconCommand(iStr);
    SendRconCommand("reloadbans");
    return 1;
}
Reply
#6

Yes, that's it.
Reply
#7

Thanks;

Another question..

If you done /ban playerid
how would you do it so it'd automatically ban the players IP?
Reply
#8

Ban(playerid); = Bans players IP.
Reply
#9

well you do know that all servers has /rcon banip and /rcon unbanip, right..?
Reply
#10

Yes.. But I wouldn't give my administrative team my RCON password...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)