25.08.2011, 17:30
pawn Код:
CMD:ban(playerid, params[])
{
if(PlayerData[playerid][AdminLevel] > 2)
{
if(sscanf(params, "us", ID, Reason)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /ban [ID] [reason]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red, "ERROR: That user is not connected!");
GetPlayerName(playerid,Nam,sizeof(Nam));
if(PlayerData[playerid][AdminLevel] < 5 && PlayerData[ID][AdminLevel] > 4) return SendClientMessage(playerid,red,"ERROR: You cannot ban over level 5 admins!");
GetPlayerName(ID, pname, sizeof(pname));
format(str, sizeof(str), "Administartor %s has banned %s from the server for: %s",Nam,pname, Reason);
SendClientMessageToAll(0xFF9900AA, str);
SendClientMessage(ID,0xFF0000FF,"Banned Wrongfully?? Go to http://www.vercettirp.smfnew.com to make a ban appeal!");
SendClientMessage(playerid,0xFF9900AA,str);
GetPlayerIp(ID,tmp3,sizeof(tmp3));
MessageToAdmins(orange,tmp3);
Ban(ID);
}
else return SendClientMessage(playerid,-1,"SERVER: Unknown command.");
return 1;
}