02.07.2014, 19:26
(
Последний раз редактировалось Edw; 26.10.2014 в 17:55.
)
Fixed.
CMD:ban(playerid, params[])
{ if(PlayerInfo[playerid][pAdmin] >= 3) { new PID; new reason[64]; new str[128]; new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; GetPlayerName(playerid, Adminname, sizeof(Adminname)); GetPlayerName(PID, Playername, sizeof(Playername)); if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]"); if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!"); format(str, sizeof(str), "'%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason); SendClientMessageToAll(COLOR_RED, str); //send that message to all Ban(PID); //Ban the playerid we've defined } else { SendClientMessage(playerid, COLOR_GREY, "You have to be level 5 to use that command!"); } return 1; } |
CMD:banip(playerid, params[])
{ new type[ 128 ], string[ 128 ] ; if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "Usage: /banip [IP]"); else { format(string, sizeof(string),"banip %s", type); SendRconCommand(string); SendRconCommand("reloadbans"); } return true; } |
CMD:unbanip(playerid, params[])
{ new type[128],string[128]; if(sscanf(params, "s[128]", type)) SendClientMessage(playerid, -1, "USAGE: /unbanip [Players IP]"); else { if(PlayerInfo[playerid][pPlayerLogged] == 0) return SendClientMessage(playerid, -1, "* You are not logged in!"); if(PlayerInfo[playerid][pAdminLevel] >= 1) { format(string, sizeof(string),"unbanip %s", type); SendRconCommand(string); SendRconCommand("reloadbans"); format(string, sizeof(string), "AdmWarning: %s has unbanned IP %s", Name( playerid ), type); SendAdminMessage(-1,string); } else { return SendClientMessage(playerid, -1 ,"You dont have access!"); } } return true; } |