GetTimers: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→Syntax) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
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. | This function returns a table of all active timers that the resource that calls it has created. Alternatively, only the timers with a remaining time less than or equal to a certain value can be retrieved. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
table getTimers ( [ | table getTimers ( [ int theTime = nil ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Optional Arguments=== | ===Optional Arguments=== | ||
*''' | *'''theTime:''' The maximum time left (in milliseconds) on the timers you wish to retrieve. | ||
===Returns=== | ===Returns=== | ||
Line 15: | Line 15: | ||
==Example== | ==Example== | ||
This example kills | This example kills timers with a remaining time of less than 1 minute. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- Find and kill all the timers with less than 1 minute to go | -- Find and kill all the timers with less than 1 minute to go |
Latest revision as of 11:26, 6 March 2019
This function returns a table of all active timers that the resource that calls it has created. Alternatively, only the timers with a remaining time less than or equal to a certain value can be retrieved.
Syntax
table getTimers ( [ int theTime = nil ] )
Optional Arguments
- theTime: The maximum time left (in milliseconds) on the timers you wish to retrieve.
Returns
Returns a table of all the active timers.
Example
This example kills timers with a remaining time of less than 1 minute.
-- 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
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace