26.01.2013, 11:01
Код:
CMD:ban(playerid, params[]) { if(pInfo[playerid][Adminlevel] < 2) { new PID; //define the playerid we wanna ban new reason[64]; //the reason, put into a string new str[128]; //a new message string 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); Ban(PID); } else { SendClientMessage(playerid, COLOR_GREY, "You have to be level 5 to use that command!"); } return 1; }