Stopping timer and starting timer with the same duration

I can't think of using SetTimerEx & SetTimer as stopping a timer and starting it again with the same duration as I stopped. How do I do that, or if someone gives me an idea on how to do it?

Well just a small idea came up to my mind not sure if it's good or not, create a variable then start every one second increase it (when the timer starts) (+1) when the timer stops, stop increasing when you wanna start another timer.

I'm not quite sure what your goal is but it seems like you want to stop a timer and restart it:

pawn Код:
new tHandle = SetTimerEx(...);

// Restarting

tHandle = SetTimerEx(...);

1. Upon SetTimerEx, store GetTickCount() in a variable, e.g. initTime
2. Upon KillTimer, set initTime to GetTickCount()-initTime
3. Upon the next SetTimerEx, just use SetTimerEx(x, interval-initTime, ...);

Forum Jump:

Users browsing this thread: 1 Guest(s)