Jail timer command problem.
#9

In the command put:

pawn Код:
SetTimerEx("Release", 1000, false, "i", targetid); // Jail the target for 45 seconds

// Somewhere else
forward Release(playerid);
public Release(playerid)
{
    if(GetPVarInt(playerid, "JailTime") <= 0)
    {
        // He's released from jail, do something
        return 1;
    }
    else
    {
        new str[50];
        format(str, sizeof(str), "You will be released in: %d", GetPVarInt(playerid, "JailTime"));
        SendClientMessage(playerid, -1, str); // Change it if you want
    }

    SetPVarInt(playerid, "JailTime", GetPVarInt(playerid, "JailTime") - 1); // Decrease the player's jail time

    SetTimerEx("Release", 1000, false, "i", playerid);
    return 0;
}
Reply


Messages In This Thread
Jail timer command problem. - by efrim123 - 08.10.2013, 19:45
Re: Jail timer command problem. - by efrim123 - 08.10.2013, 20:06
Re: Jail timer command problem. - by Jefff - 08.10.2013, 20:10
Re: Jail timer command problem. - by efrim123 - 08.10.2013, 20:16
Re: Jail timer command problem. - by iFiras - 08.10.2013, 20:28
Re: Jail timer command problem. - by efrim123 - 08.10.2013, 20:34
Re: Jail timer command problem. - by efrim123 - 08.10.2013, 20:41
Re: Jail timer command problem. - by efrim123 - 08.10.2013, 21:12
Re: Jail timer command problem. - by -Prodigy- - 08.10.2013, 21:17
Re: Jail timer command problem. - by efrim123 - 08.10.2013, 22:02

Forum Jump:


Users browsing this thread: 2 Guest(s)