SetTimerPaused: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Server client function}} __NOTOC__ {{New feature/item|3.0161|1.6.0|22701| This function allows you to pause existing running timers and resume existing paused ti...")
(No difference)

Revision as of 06:53, 5 September 2024

ADDED/UPDATED IN VERSION 1.6.0 r22701:

This function allows you to pause existing running timers and resume existing paused timers.

Syntax

bool setTimerPaused ( timer theTimer, bool paused )

OOP Syntax Help! I don't understand this!

Method: timer:paused(...)


Required Arguments

  • theTimer: The timer you wish to pause or resume.
  • paused: Whether you want to pause (true) or resume (false) the timer.

Returns

Returns true if the timer was successfully paused or resumed, false if no such timer existed.

Example

This example pauses all current timers from this resource.

-- Get a table of all current timers from this resource
local timers = getTimers ( )
-- Loop through the table of timers
for timerIndex, timerValue in ipairs( timers ) do
    -- pause each timer
    setTimerPaused ( timerValue, true )
end

See Also