GetTimers

From Multi Theft Auto: Wiki
Revision as of 18:19, 17 August 2007 by Arc (talk | contribs)
Jump to navigation Jump to search

This function returns a table of all active timers. Alternatively, only the timers with a remaining time less than or equal to a certain value can be retrieved.

Syntax

table getTimers ( [ time ] )

Optional Arguments

  • time: The maximum time left (in milliseconds) on the timers you wish to retrieve.

Returns

Returns a table of all the active timers.

Example

-- Find and kill all the timers with less than 1 minute to go
timers = getTimers ( 60000 )
-- Loop through the timer list
for timerKey, timerValue in ipairs(timers) do
	-- kill the timer
      killTimer ( timerValue )
end

See Also