16.02.2013, 14:14
Код:
CMD:banip(playerid, params[]) { if(!CheckAdmin(playerid, 1)) return NotAuthMSG(playerid); new ip[128],pIP[128],string[128]; if(sscanf(params,"s[128]",ip)) return SyntaxMSG(playerid, "/banip [IP]"); format(string, sizeof(string),"banip %s", ip); SendRconCommand(string); SendRconCommand("reloadbans"); format(string, sizeof(string), "AdmCmd: %s has just IP banned, %s.", GetName(playerid), ip); AMSG(COLOR_LIGHTRED, string); foreach(Player, i) { GetPlayerIp(playerid, pIP, sizeof(pIP)); if(!strcmp(ip, pIP, true)) { format(string, sizeof(string), "[SERVER]: Your IP %s, has been banned from the server.", pIP); KickEx(playerid, string); } } return 1; }