need help with jailtimer
#9

Quote:
Originally Posted by LazzyBoy
Посмотреть сообщение
If the timer keeps running even if the jail time has ended it means that you do not KillTimer when the time has finished.

So
KillTimer once the jail time has finished or the play was released from the jail. ( if you using a timer ofc.
I've fixed it here but how about the anti-evade shit
Код HTML:
forward jail(playerid);
public jail(playerid)
{
    AccData[playerid][JailDuration] -= 1;
    if(AccData[playerid][JailDuration] == 0)
    {
        new string[50];
        SendClientMessage(playerid, COLOR_GREEN,"You're free now, go!");
        format(string, sizeof(string), "%s has been unjailed!", GetName(playerid));
        KillTimer(jailtimer[playerid]);
        SendClientMessageToAll(COLOR_FREEROAM, string);
        SetPlayerInterior(playerid,0);
        injail[playerid] = 0;
        if(SF[playerid] == 1)
        {
            SetPlayerPos(playerid,-1604.8895,720.1664,11.8497);
            SetPlayerFacingAngle(playerid,0.2900);
        }
        else if(LS[playerid] == 1)
        {
            SetPlayerPos(playerid,1544.0620,-1675.6432,13.5577);
            SetPlayerFacingAngle(playerid,90.3087);
        }
        else if(LV[playerid] == 1)
        {
            SetPlayerPos(playerid,2286.7761,2423.7617,10.8203);
            SetPlayerFacingAngle(playerid,179.1007);
        }
        
        SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
        SetPlayerColor(playerid, COLOR_CIVIL);
        SetPlayerWantedLevel(playerid, 0);
        RemovePlayerAttachedObject(playerid, 9);
        AccData[playerid][JailDuration] = -1;
    }
    new s[25];
    format(s, sizeof(s), "Jail Time: %d Seconds", AccData[playerid][JailDuration]);
    GameTextForPlayer(playerid, s, 1000, 3);
    KillTimer(jailtimer[playerid]);
    return 1;
}
Reply


Messages In This Thread
need help with jailtimer - by MarkNelson - 26.07.2018, 19:26
Re: need help with jailtimer - by Florin48 - 26.07.2018, 19:42
Re: need help with jailtimer - by MarkNelson - 26.07.2018, 19:45
Re: need help with jailtimer - by Florin48 - 26.07.2018, 19:51
Re: need help with jailtimer - by MarkNelson - 26.07.2018, 19:59
Re: need help with jailtimer - by Florin48 - 26.07.2018, 20:04
Re: need help with jailtimer - by MarkNelson - 26.07.2018, 20:07
Re: need help with jailtimer - by LazzyBoy - 27.07.2018, 00:59
Re: need help with jailtimer - by MarkNelson - 27.07.2018, 01:29
Re: need help with jailtimer - by LazzyBoy - 27.07.2018, 01:57

Forum Jump:


Users browsing this thread: 3 Guest(s)