01.06.2012, 16:13
On top of your script
here's the command
Same concept applies for the unban command.
Код:
new IsPlayerBanned[MAX_PLAYERS] = 0;
Код:
COMMAND:ban(playerid, params[]) { new pID, reason[64]; if(!sscanf(params, "us", pID, reason)) { if(PlayerInfo[playerid][pAdmin] >= 1) { if(PlayerInfo[playerid][pAdminDuty] == 1) { new string[128]; new adminname[MAX_PLAYER_NAME]; new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, adminname, sizeof(adminname)); GetPlayerName(pID, playername, sizeof(playername)); format(string, sizeof(string), "AdmCmd: %s has been banned by %s, Reason:%s", playername, adminname, reason); SendClientMessageToAll(COLOR_RED, string); Ban(pID); IsPlayerBanned[playerid] = 1; } else return SendClientMessage(playerid, COLOR_GREY, "You need to be on admin duty in order to use this feature (/aduty)"); } else return SendClientMessage(playerid, COLOR_GREY, ".:: You are not authorised to use this command ::."); } else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [PlayerID/PartOfName] [Reason]"); return 1; }