Jail command.
#1

Hey,

I was wondering, I've created a small jail system, and was wondering how I would record players spent minutes/seconds.

Below is the code of the system so far.

pawn Код:
public SendPlayerToJail(playerid, minutes, seconds)
{
    if(IsJailed[playerid]) return 0;
    else
    {
        new rand = random(3);
        SetPlayerInterior(playerid, 6);
        switch(rand)
        {
            case 0: SetPlayerPos(playerid, 262.9825,77.4500,1001.0391);
            case 1: SetPlayerPos(playerid, 193.6294,161.8236,1003.2417);
            case 2: SetPlayerPos(playerid, 190.8504,161.0375,1003.2417);
        }
        GameTextForPlayer(playerid, "~r~JAILED", 3000, 6);
        SetTimerEx("JailTimer", Minute(minutes) + Second(seconds), false, "d", playerid);
        new String[70];
        format(String, sizeof(String), "%s (ID: %d) has been jailed.", ReturnPlayerName(playerid), playerid);
        SendClientMessageToAll(COLOR_YELLOW, String);
    }
    return 1;
}
pawn Код:
public JailTimer(playerid)
{
    GameTextForPlayer(playerid, "~g~FREEDOM", 3000, 6);
    SpawnPlayer(playerid);
    new String[70];
    format(String, sizeof(String), "%s (ID: %d) has been released from jail.", ReturnPlayerName(playerid), playerid);
    SendClientMessageToAll(COLOR_YELLOW, String);
    return 1;
}
But, however if a player quits then reconnects they'd be free again.

Thanks,

-Mike.
Reply


Messages In This Thread
Jail command. - by Isolated - 13.06.2013, 17:45
Re: Jail command. - by LilBob - 13.06.2013, 19:03
Re: Jail command. - by Isolated - 13.06.2013, 19:12
Re: Jail command. - by Juanxz - 13.06.2013, 19:17
Re: Jail command. - by LilBob - 13.06.2013, 19:18
Re: Jail command. - by Isolated - 13.06.2013, 19:32
Re: Jail command. - by LilBob - 13.06.2013, 19:42
Re: Jail command. - by Isolated - 13.06.2013, 20:38
Re: Jail command. - by Isolated - 14.06.2013, 11:33
Re: Jail command. - by Isolated - 15.06.2013, 18:22

Forum Jump:


Users browsing this thread: 1 Guest(s)