04.07.2012, 05:31
pawn Код:
JailTimer[targetid] = SetTimerEx("JailTimer", 999, true, "i", targetid);//timer wherever you place it in your gamemode.
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]);
KillTimer(JailTimer[targetid]);//killing the timer when the jailtime reaches 0
jailed[targetid] = 0;//saying that the player has been unjailed
}
return 1;
}