06.05.2010, 13:07
Код:
if(strcmp(cmd, "/ban", true) == 0) { if(PlayerInfo[playerid][Adminlevel] >= 3) { tmp = strtok(cmdtext,idx); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /ban [playerid] [reason]"); new player1 = strval(tmp); new Reason[120]; strmid(Reason,cmdtext,strlen(cmd)+strlen(tmp)+2,strlen(cmdtext)); if(IsPlayerConnected(player1)) { GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); format(string,sizeof(string),"You have banned %s from the server!(Reason: %s)", playername, Reason); SendClientMessage(playerid, COLOR_GREEN, string); format(string,sizeof(string),"Administrator %s has banned %s from the server!(Reason: %s)",adminname, playername, Reason); SendClientMessageToAll(COLOR_GREEN, string); printf("%s has banned %s from the server !(Reason: %s)",adminname, playername, Reason); Ban(player1); }else SendClientMessage(playerid, COLOR_RED, "This player is not connected"); }else SendClientMessage(playerid, COLOR_RED, "Your admin level must be more than 2"); return 1; }