help with arrest command
#4

pawn Код:
new time=wantedlevel*60;
or something of the sort.

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.
Reply


Messages In This Thread
help with arrest command - by 1fret - 09.10.2014, 17:53
Re: help with arrest command - by YanLanger - 09.10.2014, 17:56
Re: help with arrest command - by 1fret - 09.10.2014, 17:59
Re: help with arrest command - by Abagail - 09.10.2014, 22:17

Forum Jump:


Users browsing this thread: 3 Guest(s)