Seconds to minutes on --
#1

how to make this down no so fast

if(PlayerInfo[i][pJailed] > 0)
{
if(PlayerInfo[i][pJailTime] > 0)
{
PlayerInfo[i][pJailTime]--;
}

because the time of the jail goes down fast.
i want it will be like minutes
Reply
#2

help!
Reply
#3

Well to make it count down in minutes you need a timer,

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


Forum Jump:


Users browsing this thread: 2 Guest(s)