29.06.2012, 19:59
Well to make it count down in minutes you need a timer,
You would have to do something like that. Then you could add in the code so once the players time is 0 and the pJailed is greater than 0 (wich means they are jailed but time is up) it would release the player.
pawn Код:
//put this under public OnGameModeInit()
SetTimer("JailTimer",60000,true);
//this would be your timer to call the jailtimer function every minute
//then put this anywhere under a_samp outside of a callback
forward JailTimer();
public JailTimer()
{
for (new i=0; i<MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pJailed] > 0)
{
if(PlayerInfo[i][pJailTime] > 0)
{
PlayerInfo[i][pJailTime]--;
}
}
}
return 1;
}
//that would loop through every player and decrease thier jail time by 1.