How would i do this?
#9

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;
}
Reply


Messages In This Thread
How would i do this? - by Torran - 08.04.2010, 19:19
Re: How would i do this? - by biltong - 08.04.2010, 19:21
Re: How would i do this? - by Torran - 08.04.2010, 19:26
Re: How would i do this? - by biltong - 08.04.2010, 19:30
Re: How would i do this? - by Torran - 08.04.2010, 19:44
Re: How would i do this? - by biltong - 08.04.2010, 19:46
Re: How would i do this? - by Torran - 08.04.2010, 19:55
Re: How would i do this? - by dice7 - 08.04.2010, 19:58
Re: How would i do this? - by Torran - 08.04.2010, 20:19
Re: How would i do this? - by dice7 - 08.04.2010, 20:24

Forum Jump:


Users browsing this thread: 1 Guest(s)