Raised This Month: $ Target: $400
 0% 

Solved Is there a native to pause timer


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode