Jump to content

Timer onclientrender?


Bean666

Recommended Posts

Posted

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) 

Aftermath

Posted

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

Aftermath

Posted (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 by Guest

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

Posted

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]

Aftermath

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...