spAik Posted August 31, 2013 Posted August 31, 2013 addEventHandler('onGamemodeMapStart',getRootElement(), function() killTimer (votetime) local votetime = setTimer ( happen, 240000, 1 ) end) Hi i want to start a function on the start of a map. I know my script does not work, because I set the "votetime"variable after the killTimer-function. But how can I make it that a timer is created before the map, but the previous timer is also destroyed at mapstart?
Castillo Posted August 31, 2013 Posted August 31, 2013 I'm not sure if I understand, you want to set a timer when a map starts, and if the timer was already started, kill it? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Moderators IIYAMA Posted September 7, 2013 Moderators Posted September 7, 2013 addEventHandler('onGamemodeMapStart',getRootElement(), function() if isTimer(votetime) then killTimer (votetime) end local votetime = setTimer ( happen, 240000, 1 ) end) Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
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