Timer fu**ed up?
#2

you have to subtract the jail time variable in your timer with the 1 second interval

pawn Код:
JailTime[playerid]--;
pawn Код:
forward UnJail(playerid);
public Unjail(playerid)
{
    //put it here...
    if(JailTime[playerid] <= 0)
    {
        JailTime[playerid] = 0;
        KillTimer(JailTimer[playerid]);
        SetPlayerPos(playerid, 246.4798,67.8764,1003.6406);
        SetPlayerInterior(playerid, 6);
        SetPlayerVirtualWorld(playerid, -1);
        SendClientMessage(playerid, COLOR_GOLD,"[INFO]You have been UnJailed, Now try to be a good civilian!");
    }
    return 1;
}
//edit:

why dont u just use a timer with a false bool? You could remove the variable then and also u didnt have to kill the timer afterwards.
Also make sure you also add this to the killed timer (to prevent further issues)
pawn Код:
JailTimer[playerid]=-1;
Reply


Messages In This Thread
Timer fu**ed up? - by Gooday - 07.01.2012, 16:04
Re: Timer fu**ed up? - by BlackWolf120 - 07.01.2012, 16:09
Re: Timer fu**ed up? - by Aira - 07.01.2012, 16:10

Forum Jump:


Users browsing this thread: 2 Guest(s)