Bean666 Posted May 13, 2016 Posted May 13, 2016 is it possible to add a timer on this? example like after 5 seconds the DX image will disappear. because i added triggerclientevent that the DX image will show up when you finish the mission , but the DX image wont disappear. function startDrawing_CMD() if(drawingPanel == false) then addEventHandler("onClientPreRender", getRootElement(), draw); drawingPanel = true; end end addEvent("SeeGui",true) addEventHandler("SeeGui",root,startDrawing_CMD)
Bean666 Posted May 13, 2016 Author Posted May 13, 2016 yes i know. but i tried in serverside. this one wasnt working i tried to add timers on the removeeventhandler but it was kinda confusing me , this is my first time adding timers on removeventhandlers and triggerclientevent is it possible to add a removeeventhandler timer with this? or possibly when it passes 5 seconds this Event "SEEGUI" will be cancelled. triggerClientEvent(v,"SeeGui", getRootElement())
Walid Posted May 13, 2016 Posted May 13, 2016 (edited) function startDrawing_CMD() if(drawingPanel == false) then addEventHandler("onClientPreRender", root, draw); setTimer(cancelClientRender,5000,1) drawingPanel = true; end end addEvent("SeeGui",true) addEventHandler("SeeGui",root,startDrawing_CMD) -- remove the event function cancelClientRender() removeEventHandler("onClientPreRender",root, draw) return true end Edited May 13, 2016 by Guest
Bean666 Posted May 13, 2016 Author Posted May 13, 2016 hello i tried this but it doesnt trigger the event? sorry i'm kinda new in this kind of things. it's a timer table setTimer(function() triggerClientEvent(v,"HideGui", getRootElement()) end, 2000, 1); bad argument: triggerclientevent [Expected string at argument 1, got nil]
Bean666 Posted May 13, 2016 Author Posted May 13, 2016 (edited) EDIT: FIXED Edited May 13, 2016 by Guest
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