Problem with Timers
#1

Hi,
ill have a Timer in my Script which for example checks the Time to the next PayDay, so it decreases a integer until its zero. Sometimes it happens, that the Time stops decreasing every minute, every other Check in this public, which is called by a repeating Timer (createt under OnGameModeInit) stopss to, so there seems to be a problem with it. In this Timer, theres just a loop, which loops through all Players, so something like
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
   if(IsPlayerConncted(i)) // Do Something
}
Then there are some checks which decreases/increses some variables, so something for PayDay
Код:
if(pInfo[i][pPayCheck] > 0) pInfo[i][pPayCheck]--;
if(pInfo[i][pPayCheck] > 0) PayDay();
So nothing important, i would like to give you the code roight now, but i cant, because i have no acces to the script right now, but it looks more or less like this, just some basic checks. Its also for setting the actual server time and stuff like that.
So what could be the reason, that the timer jszt stops or at least whats the reason for, that it stops decreasing or increasing variables in this public? As i alreasy said its a repeating Timer, so it could be, that the Timer is stopped somehow or that theres something wrong inside the public, so it stops looking through all of the Code.
Hope some of you guys had this problem before
Reply
#2

Make sure you don't have break or return in that loop.
Reply
#3

Already cheched that. That problem seems to correct for the player if he reconnects... Strange
Reply
#4

Maybe post the loop so I (or anyone else) can check it out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)