Type Sets1
SymbolDescription
TimerAny of the following prototypes will work for a timed function.
Defines5
SymbolDescription
TIMER_DATA_HNDL_CLOSETimer will automatically call CloseHandle() on its data when finished
TIMER_FLAG_NO_MAPCHANGETimer will not carry over mapchanges
TIMER_FLAG_TICK_PRECISETimer will have tick level time precision
TIMER_HNDL_CLOSEDeprecated define, replaced by below
TIMER_REPEATTimer will repeat until it returns Plugin_Stop
Forwards1
SymbolDescription
OnMapTimeLeftChangedNotification that the map's time left has changed via a change in the time limit or a change in the game rules (such as mp_restartgame). This is useful for plugins trying to create timers based on the time left in the map. Calling ExtendMapTimeLimit() from here, without proper precaution, will cause infinite recursion. If the operation is not supported, this will never be called. If the server has not yet processed any frames (i.e. no players have joined the map yet), then this will be called once the server begins ticking, even if there is no time limit set.
Functions10
SymbolDescription
CreateDataTimerCreates a timer associated with a new datapack, and returns the datapack.
CreateTimerCreates a basic timer. Calling CloseHandle() on a timer will end the timer.
ExtendMapTimeLimitExtends the map time limit in a way that will notify all plugins.
GetMapTimeLeftReturns an estimate of the time left before the map ends. If the server has not processed any frames yet (i.e. no players have joined the map yet), then the time left returned will always be infinite.
GetMapTimeLimitRetrieves the current map time limit. If the server has not processed any frames yet (i.e. no players have joined the map yet), then the time limit returned will always be 0.
GetTickedTimeReturns the simulated game time. This time is internally maintained by SourceMod and is based on the game tick count and tick rate. Unlike GetGameTime(), it will increment past map changes and while no players are connected. Unlike GetEngineTime(), it will not increment based on the system clock (i.e. it is still bound to the ticking process).
GetTickIntervalReturns the number of seconds in between game server ticks. Note: A tick, in this context, is a frame.
IsServerProcessingReturns whether or not the server is processing frames or not. The server does not process frames until at least one client joins the game. If server hibernation is disabled, once the first player has joined, even if that player leaves, the server's timers and entities will continue to work.
KillTimerKills a timer. Use this instead of CloseHandle() if you need more options.
TriggerTimerManually triggers a timer so its function will be called.