The timer begins work only when first player join the server

Hello.
I have a function:



function GA_Multiserv_Heartbeat()
	GA_Multiserv_Get()
	GA_Multiserv_Upd()
end
timer.Create("ga_heartbeat", 30, 0, GA_Multiserv_Heartbeat)


But it starts working only when first player joined the server. After that, even if that player leave, timer continues work…
How to make it work right after server start?
P.S. scriptenforcer is 1, and os is Windows Server 2003(maybe os problem?)

I noticed the exact same. As long as no person joined, everything is “frozen” (Watch the CPU: 0%). But if then someone joins and leaves, CPU is > 0% and timers run.

Try spawning a bot and removing it again. (Spawn it using the Initialize hook and start a timer then to remove him 1 second later). The time could start now.

Thanks, i’ll try it

[editline]12:33PM[/editline]

Server crashing when i creating bot on Initialize hook…
And i cant delay it because timers don’t working :frowning:

Just to add my two cents to the thread,
I used to use that bot trick but ended up using SourceMod as it was sufficient enough for my needs and had timers and didn’t cause CPU rise due of “server unfreeze even without players”.

feature request for new timers independent from the engine?

Is this also the same/same problem for Think hooks?

Yes, just tryed Think - it sleeps too…

[editline]12:57PM[/editline]

I did it - added “bot” in the end of server.cfg, and kick function to PlayerInitialSpawn.
Now it works :slight_smile: