SA-MP Forums Archive
settimer loop in OnGameModeInit bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: settimer loop in OnGameModeInit bug (/showthread.php?tid=72219)



settimer loop in OnGameModeInit bug - nico005 - 07.04.2009

hi,

I have 4 settimer who run on the OnGameModeInit, settimer(n1,1000,1) settimer(n2,1000,1) settimer(n3,1000,1) settimer(n4,1000,1) all +- 1200 lines.

So i have changed the timer numbers, 5 or i make settimer(tt,500,0) tt=settimer(n4,1000,1) or add timer_add
but they are always sometime a settimer who dont run for a player or everybody.

cc: 1200 lines is many for to be read in 1 sc i thinks.


Re: settimer loop in OnGameModeInit bug - Kinetic - 07.04.2009

are you defining variables to the timers?

example:
Код:
new timer;
forward Timer();
public OnGameModeInit()
{
  timer = SetTimer("Timer", 1000, true);
  return 1;
}



Re: settimer loop in OnGameModeInit bug - nico005 - 07.04.2009

yes it's work, but when its run together sometime, a settimer dont work for all players


Re: settimer loop in OnGameModeInit bug - Kinetic - 07.04.2009

Quote:
Originally Posted by nico005
yes it's work, but when its run together sometime, a settimer dont work for all players
it will always work if you do it right tho :P

Inside that timer, use a for loop to get all player ids

Код:
for(new i=0; i<=GetMaxPlayers(); i++)



Re: settimer loop in OnGameModeInit bug - nico005 - 07.04.2009

yes i have that. there is no bug in the timer , just that run together and maybe with +1200 lines for to read Less 1 sc...