GTX Posted June 12, 2013 Share 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. Link to comment
Moderators IIYAMA Posted June 13, 2013 Moderators Share 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 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