08.04.2010, 20:19
pawn Код:
CMD:jail(playerid, params[])
{
new id, time, reason[128];
new string[128];
if(!(BaseInfo[playerid][AdminLevel] > 1)) return SendClientMessage(playerid, COLOR_RED, "You are not an administrator with the required level");
if(sscanf(params, "uiz", id, time, reason)) return SendClientMessage(playerid, COLOR_RED, "Usage: /jail [PlayerID/PartOfName] [Time] [Reason]");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not Found");
if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Cannot jail Yourself");
if(BaseInfo[id][AdminLevel] > 4) return SendClientMessage(playerid, COLOR_RED, "Cannot jail the Highest Level Admin");
if(!reason[0]) {
format(string, sizeof string, "Administrator %s has jailed %s for %i miliseconds", GetPlayersName(playerid), GetPlayersName(id), time);
SendClientMessageToAll(COLOR_BLUE, string);
SetTimerEx("Unjail", time, 0, "i", playerid);
JailPlayer(id);
return BaseInfo[id][Jailed] = 1;
}
format(string, sizeof string, "Administrator %s has jailed %s for %i miliseconds with reason: %s", GetPlayersName(playerid), GetPlayersName(id), time, reason);
SendClientMessageToAll(COLOR_BLUE, string);
SetTimerEx("Unjail", time, 0, "i", playerid);
BaseInfo[id][Jailed] = 1;
JailPlayer(id);
return 1;
}