Timer stops incrementing variable after a while.
#1

pawn Код:
forward HourTimer();
public HourTimer()
{

   
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerNPC(i)) continue;
        if(!IsPlayerConnected(i) ) continue;
        if(PlayerStats[i][Minutes] >= 60)
        {
            if(PlayerStats[i][Hours] == 0)
            {
                SendClientMessage(i,0xffffff,"{FFFFFF}level up obtained, You have recieved $20000");
                SendClientMessage(i,0xffffff,"{FFFFFF}Next level: 23 hours, Reward: ");
                GivePoints(i,20000);
                if(PlayerStats[i][Level] == 0)
                {
                    PlayerStats[i][Level] = 1;
                    ResetColor(i);
                }
            }
            if(PlayerStats[i][Hours] == 23)
            {
                SendClientMessage(i,0xffffff,"{FFFFFF}Level up obtained, maximum level reached for now.");
                GivePoints(i,75000);
                if(PlayerStats[i][Level] == 1)
                {
                    PlayerStats[i][Level] = 2;
                    ResetColor(i);
                }
            }
            PlayerStats[i][Hours]++;
            PlayerStats[i][Minutes] = 0;
            UpdateScore(i);
            HUDUpdateHours(i);
            continue;
        }
        else
        {
            PlayerStats[i][Minutes]++;
        }
    }
}

any ideas?
Reply
#2

As i was fluttering on your code, i think you should remove
Quote:

continue;

Reply
#3

Believe I fixed the problem, I was killing an invalid timer and considering this is probably my most frequent timer, it had to be the reason this was stopping.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)