PauseTimer: Difference between revisions

From Onset Developer Wiki
No edit summary
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{Info|Function|Server & Client|1.0}}
{{Info|Function|Server & Client|1.0}}


{{FuncDescription|__EDIT_ME__}}
{{FuncDescription|Pauses the specified timer.}}


{{FuncSyntax|PauseTimer(timer)}}
{{FuncSyntax|PauseTimer(timer)}}


{{FuncParameters}}
{{FuncParameters}}
{{FuncParam|timer|__EDIT_ME__}}
{{FuncParam|timer|The timer identifier}}


{{FuncReturnValue|__EDIT_ME__}}
{{FuncReturnValue|Returns '''true''' on success, '''false''' on error.}}


== Example ==
== Example ==
__EDIT_ME__
<syntaxhighlight lang="Lua>
function pauseTimers()
    for index, timer in ipairs(GetAllTimers()) do
        PauseTimer(timer)
    end
end
 
function resumeTimers()
    for index, timer in ipairs(GetAllTimers()) do
        UnpauseTimer(timer)
    end
end
</syntaxhighlight>


{{RelatedFunctions}}
{{RelatedFunctions}}
__EDIT_ME__
{{Template:TimerFunctions}}

Latest revision as of 17:16, 27 May 2021

PauseTimer

Type: Function
Context: Server & Client
Introduced: v1.0

Description

Pauses the specified timer.

Syntax

PauseTimer(timer)

Parameters

  • timer
    The timer identifier

Return Value

  • Returns true on success, false on error.

Example

function pauseTimers()
    for index, timer in ipairs(GetAllTimers()) do
        PauseTimer(timer)
    end
end

function resumeTimers()
    for index, timer in ipairs(GetAllTimers()) do
        UnpauseTimer(timer)
    end
end

See also