Jump to content

Timer onclientrender?


Bean666

Recommended Posts

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) 

Link to comment

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()) 
  

Link to comment
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 by Guest
Link to comment

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]

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...