Range Banning
#9

Weird, I don't remember 'AddRangeBan' being a function?

pawn Код:
CMD:rban(playerid, params[])
{
    LoginCheck(playerid);
    LevelCheck(playerid, 4);
    new id, reason[20];
    if(sscanf(params, "uS(No Reason)[20]", id, reason)) return SendUsage(playerid, "/rban <PlayerID> <Reason(Optional)>", "Range bans the specified player's IP.");
    if(id == INVALID_PLAYER_ID || !IsPlayerConnected(id)) return SendError(playerid, "Player is not connected.");
    if(id == playerid) return SendError(playerid, "You cannot ban yourself.");
    if(pInfo[playerid][Admin] < pInfo[id][Admin]) return SendError(playerid, "You cannot use this command on a higher level administrator.");
    new str[128], ip[16];
    ClearChatB(id, 100);
    format(str, sizeof(str), "{AFAFAF}%s{FF6347} has been ranged banned by [ADMIN] {AFAFAF}%s{FF6347} (Reason: {AFAFAF}%s{FF6347})", GetName(id), GetName(playerid), reason);
    SendClientMessageToAll(COLOR_CHAT, str);
    format(str, sizeof(str), "You have range banned {AFAFAF}%s{FF6347} (Reason: {AFAFAF}%s{FF6347})", GetName(id), reason);
    SendClientMessage(playerid, COLOR_CHAT, str);
    format(str, sizeof(str), "You have been banned by [ADMIN] {AFAFAF}%s{FF6347}", GetName(playerid));
    SendClientMessage(id, COLOR_CHAT, str);
    PlaySoundForAll(1140);
    GetPlayerIp(id, ip, sizeof(ip));
    split(ip, range, '.');
    format(reason, sizeof(reason), "banip %s.%s.*.*", range[0], range[1]);
    SendRconCommand(reason);
    SendAdm(playerid, "RBAN");
    return 1;
}
There's no need to use 'reloadbans' either, you only really need to do that when you unban someone.
Reply


Messages In This Thread
Range Banning - by sgtph3n1x - 13.06.2014, 03:34
Re: Range Banning - by nmader - 13.06.2014, 03:40
Re: Range Banning - by sgtph3n1x - 13.06.2014, 03:51
Re: Range Banning - by nmader - 13.06.2014, 04:01
Re: Range Banning - by sgtph3n1x - 13.06.2014, 04:07
Re: Range Banning - by nmader - 13.06.2014, 04:11
Re: Range Banning - by sgtph3n1x - 13.06.2014, 04:32
Re: Range Banning - by Laure - 13.06.2014, 05:14
Re: Range Banning - by Threshold - 13.06.2014, 06:35
Re: Range Banning - by Laure - 13.06.2014, 07:38

Forum Jump:


Users browsing this thread: 2 Guest(s)