View Single Post
boink
Member
Join Date: May 2021
Location: Australia
Old 08-01-2022 , 18:57   Re: What IS The Simplest Way To Pause Timer
Reply With Quote #5

There is no native way to 'pause' a timer, you will need to assign the timer handle to a variable, and keep track of the round time yourself. When you need to pause it, you delete/kill the timer, then when you start it again, create the timer again and subtract whatever time has passed since you first started it + the amount of time since pausing it.

Alternatively, you could have a repeating timer at a 1.0 second interval and manually subtract the time from within the timer callback, when it's in a 'paused' state, don't subtract the time and exit the function. Once the time variable you have set hits 0, run whatever code you need.
__________________
@.boink. on Discord | DM for Plugin Requests | Tip Jar

Last edited by boink; 08-01-2022 at 18:57.
boink is offline