13.06.2014, 06:35
Weird, I don't remember 'AddRangeBan' being a function?
There's no need to use 'reloadbans' either, you only really need to do that when you unban someone.
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;
}