GTX Posted June 12, 2013 Posted June 12, 2013 How can I send a timer (so, I can do getTimerDetails later) from server-side to client-side? At the moment, I'm using this: Server-sided code: function endA() -- Something. end endTimer = setTimer(endA, 60000, 1) if isTimer(endTimer) then -- Success. triggerClientEvent("onTimerRecieve", root, endTimer) end Client-sided code: local endTimer function draw() if isTimer(endTimer) then -- Nothing here. Maybe timer is not timer? local a, b, c = getTimerDetails(endTimer) if a then dxDrawText(a, 10, 10) end end end addEventHandler("onClientRender", root, draw) addEvent("onTimerRecieve", true) addEventHandler("onTimerRecieve", root, function(timer) -- Success till here. outputDebugString(type(timer)) -- Returns: userdata. endTimer = timer end ) The text doesn't draw. Maybe sent timer isn't a timer? Thanks in advance. Do you require a paid scripter? Contact me! (Unavailable) Currently I am experienced in Lua, PHP, HTML, CSS, SQL and JS. Developer and owner of https://projectbea.st - Project Beast
Castillo Posted June 12, 2013 Posted June 12, 2013 isTimer returns false? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Moderators IIYAMA Posted June 13, 2013 Moderators Posted June 13, 2013 It is a server timer and it isn't running at client side. you can change this: --if isTimer(endTimer) then if endTimer then 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