Is there a native to pause timer
Hello Everyone,
I want an easy way to pause and resume timer, lets take this script by "RU_6uK" as an example PHP Code:
Thanks |
Re: What IS The Simplest Way To Pause Timer
Wrong section :roll:
|
Re: What IS The Simplest Way To Pause Timer
delete and create the timer
or use return Plugin_Continue; while some condition is false. |
Re: What IS The Simplest Way To Pause Timer
That will reset the timer, I want it in a way like it passed 30 seconds, I can pause the 30 sec until a condition is triggered then resume the 30 seconds again.
for example the round duration is now 5 min, I want to pause it, then allow it to continue 5:01 and so on, not resting it to 0 and then starting all over again |
Re: What IS The Simplest Way To Pause Timer
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. |
Re: What IS The Simplest Way To Pause Timer
Got it, thank you
|
Re: What IS The Simplest Way To Pause Timer
PHP Code:
|
Re: What IS The Simplest Way To Pause Timer
Thats more than clear now Earendil, Thank you very much as always :fox:
|
All times are GMT -4. The time now is 05:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.