Timer that stops and resumes?
#1

How do i make a timer that stops when u do something then resumes when u do something else at the time it left off at?

For example /stop stops the timer and /start continues the timer where it left off.
Reply
#2

make a boolean for that... and use that inside /stop or /start and change the value to boolean to True Or False ...
In the timer funtion, check the boolean variable, if its True, then timer will contiue, else if its Flase, it will just return back wothout doing anything inside the timer.

Like:
Код:
new SetTimerActive=true;
now inside Start command add
Код:
 SetTimerActive=true;
and uder Stop command add this
Код:
SetTimerActive=false;
Under the Timer Function add this
Код:
if(!SetTimerActive) return 1;
Tell me if it would work./....I am 98% sure that it will ..

Thank You
-Abhinav
Reply
#3

Quote:
Originally Posted by ۞●•λвнiиаv•●۞
make a boolean for that... and use that inside /stop or /start and change the value to boolean to True Or False ...
In the timer funtion, check the boolean variable, if its True, then timer will contiue, else if its Flase, it will just return back wothout doing anything inside the timer.

Like:
Код:
new SetTimerActive=true;
now inside Start command add
Код:
 SetTimerActive=true;
and uder Stop command add this
Код:
SetTimerActive=false;
Under the Timer Function add this
Код:
if(!SetTimerActive) return 1;
Tell me if it would work./....I am 98% sure that it will ..

Thank You
-Abhinav
I want it to resume from the point it stopped at tho, not start all over.
Reply
#4

Yes, It will do the same... If you want..i can show you a simple example for that, then you may modify it on your own.

Thank You
-Abhinav
Reply
#5

Quote:
Originally Posted by ۞●•λвнiиаv•●۞
Yes, It will do the same... If you want..i can show you a simple example for that, then you may modify it on your own.

Thank You
-Abhinav
With your method the timers functions will stop but the timer will keep going. I need the timer to stop so that it can resume from the place it left off.

So basically when u type /stop it saves the current time it is at and when u say /start it starts a timer where the last one left off.
Reply
#6

Whats the difference if the timer stops or not?

If the variable is false then nothing will happen anyway

The only other thing you could do is KillTimer then SetTimer again which is pointless..

Why do you want it to stop anyway? So you can be helped better... ?
Reply
#7

Thats what i want to say, if the timers wil be unfunctional then it means that nothing is there....No means whether timer is active or not beacause it will be UnFunctional ......... RIGHT BMUK?

Thank You
Abhinav
Reply
#8

Quote:
Originally Posted by ۞●•λвнiиаv•●۞
Thats what i want to say, if the timers wil be unfunctional then it means that nothing is there....No means whether timer is active or not beacause it will be UnFunctional ......... RIGHT BMUK?

Thank You
Abhinav
I need it to resume where it left off otherwise u could type /stop wait a while then when u press /start the timer is already finished. Yes yours make the function not work but you don't know what I'm trying to do. Let me explain...

When the player needs to stay in the checkpoint for 30 seconds. If they leave the checkpoint the timer stops. Once they enter the checkpoint again they only need to stay in it for remaining time.
Reply
#9

Then tell what you want to do .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)