04.07.2012, 05:23
Okay, so basically, when the player gets arrested 2 timers start, the UnJail timer (working) and the Text draw timer showing time left (semi-working)
The JailTime timer counts down from 30 sucesfully but when it reaches 1 the text draw doesnt hide and it stays at "time remaining: 1"
then when the next player is arrested it shows the timer for the previous arrest player but the timer is going faster. it counts down from 30, id say about in 10-15 seconds.
The JailTime timer counts down from 30 sucesfully but when it reaches 1 the text draw doesnt hide and it stays at "time remaining: 1"
then when the next player is arrested it shows the timer for the previous arrest player but the timer is going faster. it counts down from 30, id say about in 10-15 seconds.
pawn Код:
SetTimerEx("JailTimer", 999, true, "i", targetid);
pawn Код:
public JailTimer(targetid)
{
jailtime--;
if(jailtime > 0 && jailed[targetid] == 1)
{
new string[10];
format(string,sizeof(string), "%i", jailtime);
TextDrawSetString(JailTime[1], string);
TextDrawShowForPlayer(targetid, JailTime[0]); //message saying Time Remaining
TextDrawShowForPlayer(targetid, JailTime[1]); //the actual time being shown
}
else if (jailtime == 0)
{
TextDrawHideForPlayer(targetid, JailTime[0]);
TextDrawHideForPlayer(targetid, JailTime[1]);
}
return 1;
}