Xeno Posted October 20, 2012 Share Posted October 20, 2012 How would I detect when 24 hours has gone? And I would also like to put this on a loop, so for example --sets the 24 hour timer --hits 00:00 GMT time --ouputchatchat --does it all again How would I do this? I literally have no smegging clue. Link to comment
Scooby Posted October 20, 2012 Share Posted October 20, 2012 try this: local loopedTimer = nil function startLoopTimer(player,cmd) if isTimer(loopedTimer) then outputChatBox("Error - Timer already Active!",player,255,0,0) else loopedTimer = setTimer(twentyfourhours,86400000,0) outputChatBox("24hr timer started",root,255,0,0) end end addCommandHandler("startLoop",startLoopTimer) function twentyfourhours() outputChatBox("24hour loop timer restarted",root,255,0,0) end function stopLoopTimer(player,cmd) if isTimer(loopedTimer) then killTimer(loopedTimer) end end addCommandHandler("stopLoop",stopLoopTimer) this will start and run endlessly outputting every 24hrs of course the 24hrs start when u start it, not at 00:00 Link to comment
Smart. Posted October 20, 2012 Share Posted October 20, 2012 You coud use getRealTime which would be smarter imo Link to comment
Tete omar Posted October 21, 2012 Share Posted October 21, 2012 smarter than what? I think he meant just for "short". Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now