setImmediate: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 6: | Line 6: | ||
|desc = add a timer with a callback function that is invoked on the next tick | |desc = add a timer with a callback function that is invoked on the next tick | ||
|arg1 = function callback The scripting function to call on the next tick. | |arg1 = function callback The scripting function to call on the next tick. | ||
|arg2 = [vararg ... = | |arg2 = [vararg ... = (no arguments)] The arguments to send to the callback function. | ||
|return = Timer a handle to the timer | |return = Timer a handle to the timer | ||
|freturn = null n/a | |freturn = null n/a | ||
|cb1arg1 = ... vararg The arguments that were sent to the <code>setImmediate</code> function. | |cb1arg1 = ... vararg The arguments that were sent to the <code>setImmediate</code> function. | ||
|notes = GTA Connected guarantees that the function will | |notes = GTA Connected guarantees that the function will run in the next frame where possible, remember that frame rates will affect how soon that is. | ||
}} | }} |
Latest revision as of 13:16, 29 February 2024
Function
Server and Client
Online and Offline
Available since Server 1.0.0, Client 1.0.0
Timer setImmediate(function callback, [ vararg ... = (no arguments) ])
The setImmediate function is used to add a timer with a callback function that is invoked on the next tick.
Parameters
1) | function | callback | The scripting function to call on the next tick. |
2) | vararg | ... | Optional, defaults to (no arguments). The arguments to send to the callback function. |
Return
Timer | A handle to the timer. |
Callbacks
function callback(... vararg)
1) | ... | vararg | The arguments that were sent to the setImmediate function.
|
Notes
- GTA Connected guarantees that the function will run in the next frame where possible, remember that frame rates will affect how soon that is.
Examples
There aren't any examples for this function.
Compatibility
There isn't any compatibility information for this function.
Related
Server Related
clearImmediate
clearInterval
clearTimeout
setImmediate
setInterval
setTimeout
Client Related
clearImmediate
clearInterval
clearTimeout
setImmediate
setInterval
setTimeout