Question
#2

pawn Код:
CMD:jail(playerid, params[])
{
    if(pInfo[playerid][Adminlevel] < 2) {
        return 1;
    }
    new
        iTargetID,
        iJailSeconds
    ;
    if (!sscanf(params, "ud", iTargetID, iJailSeconds))
    {
        if (!IsPlayerConnected(iTargetID)) {
            return SendClientMessage(playerid, -1, "Player is not connected.");
        }
        else if (iJailSeconds < 0 || iJailSeconds > 500000) {
            return SendClientMessage(playerid, -1, "Invalid amount of time.");
        }
        new iRandSpawn = random(sizeof(PrisonSpawn));
        SetPlayerPos(iTargetID, PrisonSpawn[iRandSpawn][0], PrisonSpawn[iRandSpawn][1], PrisonSpawn[iRandSpawn][2]);

        SetPlayerInterior(iTargetID, 10);
        SetPVarInt(iTargetID, "JailTime", iJailSeconds);
        SetTimerEx("@Release", iJailSeconds * 1000, false, "d", iTargetID);
    }
    else SendClientMessage(playerid, -1, "USAGE: /jail [playerid] [seconds]");
    return 1;
}
Reply


Messages In This Thread
Question - by DarkLored - 18.11.2013, 23:30
Re: Question - by Emmet_ - 18.11.2013, 23:53
Re: Question - by DarkLored - 19.11.2013, 00:24
Re: Question - by Pottus - 19.11.2013, 00:55

Forum Jump:


Users browsing this thread: 1 Guest(s)