Estevam2d Posted August 31, 2014 Share Posted August 31, 2014 Hi guys, i am with an problem can help-me ? I'm not achieving canceled set time when entering the vehicle. I do not want to destroy the vehicle when returning to the car. I am very beginner in the area to cancel a function sorry bad english. local car = 10000 function desapar() setTimer(destroyElement, car, 1, source) end addEventHandler("onVehicleStartExit",getRootElement(),desapar) addEventHandler("onVehicleStartEnter", getRootElement(), function ( theplayer, seat, jacked ) destroyElement ( car) end ) Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 local car = 10000 function desapar() setTimer(destroyElement, car, 1, source) end addEventHandler("onVehicleStartExit",getRootElement(),desapar) addEventHandler("onVehicleStartEnter", getRootElement(), function ( theplayer, seat, jacked ) destroyElement ( source ) end ) Link to comment
tosfera Posted August 31, 2014 Share Posted August 31, 2014 You can't destroy a timer, you have to use killTimer to make it stop. Link to comment
Estevam2d Posted August 31, 2014 Author Share Posted August 31, 2014 I havê made this way yet the vehicle disappears with time. what's wrong? local car = 10000 function desapar() setTimer(destroyElement, car, 1, source) end addEventHandler("onVehicleStartExit",getRootElement(),desapar) function test() if isTimer ( car ) then killTimer ( car ) end end addEventHandler("onVehicleStartEnter",getRootElement(),test) Link to comment
Anubhav Posted August 31, 2014 Share Posted August 31, 2014 local carT = 10000 function desapar() car = setTimer(destroyElement, carT, 1, source) end addEventHandler("onVehicleStartExit",getRootElement(),desapar) function test() if isTimer ( car ) then killTimer ( car ) end end addEventHandler("onVehicleStartEnter",getRootElement(),test) Link to comment
Estevam2d Posted August 31, 2014 Author Share Posted August 31, 2014 thanks for that helped me a lot. I learned another lesson with you. 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