27.07.2018, 01:29
Quote:
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. |
Код 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; }