09.10.2014, 22:17
pawn Код:
new time=wantedlevel*60;
Basically their wanted level is timed by 60, - which can then become the amount of seconds they serve. For example, - for having one star they will serve 60 seconds. Then store the amount of time in a variable somewhere and do something like this to check if they're time has passed,
(Run the timer somewhere, or use something such as y_timers). Make sure it repeats if they're in jail.
PlayerTimer[playerid] = SetTimerEx("Update", 1000, true, "i", playerid);
public Update(playerid)
{
JailTime[playerid] = JailTime[playerid]-1;
if(JailTime[playerid]==0)
{
KillTimer(PlayerTimer[playerid]);
PlayerTimer[playerid] = 0;
// release them
}
}[/pawn]
This method is unsufficent and I'd recommend using Unix Timestamps, how-ever this should help you.