• Starting and Stopping Timers
    3 replies, posted
I've always hated doing this because they return false if they are already stopped or already started, so how can I check if the timer is running and if it is stop it, else if it is stopped then just let it be
To check if a timer is running: [b][url=http://wiki.garrysmod.com/?title=Timer.IsTimer]Timer.IsTimer [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] To stop a timer: [b][url=http://wiki.garrysmod.com/?title=Timer.Destroy]Timer.Destroy [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] Not quite sure what your asking exactly, though.
[QUOTE=Saint Devil;21804532]To check if a timer is running: [b][url=http://wiki.garrysmod.com/?title=Timer.IsTimer]Timer.IsTimer [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] To stop a timer: [b][url=http://wiki.garrysmod.com/?title=Timer.Destroy]Timer.Destroy [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] Not quite sure what your asking exactly, though.[/QUOTE] I need to check if a timer is already stopped, because you know how if you use Timer.stop on a timer thats already stopped it messes some things up..well I need to check if its already stopped and if it is then do nothing but if it isn't stopped then stop it.
Then do a check with Timer.IsTimer and if that's true, stop it.
Sorry, you need to Log In to post a reply to this thread.