Timer save glitch/missing lines
#6

This is a little bit more complex, but not too much. You need to store the time remaining, so:

pawn Код:
//change
if(g_var[playerid] == 1)
//to
if(PlayerInfo[playerid][pCountDown])

//change
if(g_var[playerid] == 0 //(... rest of the line)
//to
if(!PlayerInfo[playerid][pCountDown] //(...)

//change
SetTimerEx("CountDown",1200*1000, false, "d", playerid);
//to
PlayerInfo[playerid][pCountDown] = 20 * 60; //time stored in seconds
SetTimerEx("CountDown", 1000, false, "d", playerid);

//change
public CountDown(playerid)
{
    g_var[playerid] = 0;
}
//to
public CountDown(playerid)
{
    if(PlayerInfo[playerid][pCountDown]-- > 0) {
        SetTimerEx("CountDown", 1000, false, "d", playerid);
    }
}

//In OnPlayerLogin or similar
if(PlayerInfo[playerid][pCountDown]) {
    SetTimerEx("CountDown", 1000, false, "d", playerid);
}
Reply


Messages In This Thread
Timer save glitch/missing lines - by weedxd - 08.01.2015, 18:35
Re: Timer save glitch/missing lines - by Misiur - 08.01.2015, 19:20
Re: Timer save glitch/missing lines - by weedxd - 08.01.2015, 19:35
Re: Timer save glitch/missing lines - by Misiur - 08.01.2015, 19:46
Re: Timer save glitch/missing lines - by weedxd - 08.01.2015, 20:28
Re: Timer save glitch/missing lines - by Misiur - 08.01.2015, 21:49
Re: Timer save glitch/missing lines - by weedxd - 08.01.2015, 22:03
Re: Timer save glitch/missing lines - by Misiur - 08.01.2015, 22:27
Re: Timer save glitch/missing lines - by weedxd - 08.01.2015, 22:36

Forum Jump:


Users browsing this thread: 1 Guest(s)