22.08.2012, 14:18
Hey guys this is my /ban cmd
And I want to add
( The low-ranked admins can't ban the high-ranked ones, so a trial admin can't ban the owner etc )
pawn Code:
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
new targetid, reason[64], string[128];
if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_DGREY"[CMD] / "#COL_SGREY"[PlayerID/PartOfName] [Reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_WHITE, ""#COL_ORANGE"[ERROR]"#COL_LRED" Player not connected!");
{
new pTargetName[24], pName[24];
GetPlayerName(playerid,pName,24);
GetPlayerName(targetid,pTargetName,24);
format(string, sizeof(string), ""#COL_ORANGE"[SERVER]"#COL_LRED" Admin %s has IP banned %s: %s", pName, pTargetName, reason);
SendClientMessageToAll(COLOR_RED,string);
Ban(targetid);
}
return 1;
}
( The low-ranked admins can't ban the high-ranked ones, so a trial admin can't ban the owner etc )