16.11.2014, 11:25
This is my /banip cmd
And this is my /unbanip cmd
Код:
CMD:banip(playerid, params[]) { if(IsPlayerConnected(playerid)) { new string[128], tmp[32]; if(sscanf(params, "s[32]", tmp)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /banip [ip]"); if(PlayerInfo[playerid][pAdmin] >= 6) { AddBan(tmp); format(string, sizeof(string), "AdmCmd: %s has banned IP:%s", GetPlayerNameEx(playerid), tmp); ABroadCast(COLOR_LIGHTRED,string,2); } else { SendClientMessage(playerid, COLOR_GRAD2, " You are not authorized to use that command !"); } } return 1; }
Код:
CMD:unbanip(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 4 { if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /unbanip [ip]"); if(IsValidIP(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "That is not a valid IP address!"); new string[128], year, month,day; getdate(year, month, day); RemoveBan(params); format(string, 128, "AdmCmd: %s has unbanned IP %s", GetPlayerNameEx(playerid), params); ABroadCast(COLOR_LIGHTRED,string,2); format(string, sizeof(string), "AdmCmd: %s has unbanned IP %s (%d-%d-%d)", GetPlayerNameEx(playerid), params, month, day, year); Log("logs/ban.log", string); print(string); } return 1; }