GetTimers: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
This function returns a table of all the timers (with the remaining time left below or equal to the time specified)
{{Server client function}}
This function returns a table of all the timers (with the remaining time left below or equal to the time specified).


==Syntax==  
==Syntax==  
Line 8: Line 9:


===Optional Arguments===  
===Optional Arguments===  
*'''time:''' The maximum time left(ms) on the timers you wish to add to the table.
*'''time:''' The maximum time left (in miliseconds) on the timers you wish to add to the table.


===Returns===
===Returns===

Revision as of 16:45, 10 August 2007

This function returns a table of all the timers (with the remaining time left below or equal to the time specified).

Syntax

table getTimers ( [ time ] )

Optional Arguments

  • time: The maximum time left (in miliseconds) on the timers you wish to add to the table.

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