Fist Posted April 30, 2017 Posted April 30, 2017 As title says, how can i pass timer that has been created on server side to the client? I tried doing with setElementData(element,"timer",timer) as it is synced between server and client but when i tried to get timer with getElementData(element,"timer") on client it returned nothing but when i try it on server side, all works. Any solutions?
NeXuS™ Posted April 30, 2017 Posted April 30, 2017 (edited) What do you need the timer for? Edited April 30, 2017 by NeXuS™
Fist Posted April 30, 2017 Author Posted April 30, 2017 (edited) 23 minutes ago, NeXuS™ said: What do you need the timer for? To get how much time is left in timer to show it on screen for client and timer is being used on server side to tell when end Round. Edited April 30, 2017 by Fist
undefined Posted April 30, 2017 Posted April 30, 2017 (edited) Where is element defined? You must use resourceRoot. setElementData(resourceRoot,...) Edited April 30, 2017 by ZoRRoM
NeXuS™ Posted April 30, 2017 Posted April 30, 2017 (edited) Easily, you could trigger a starting function to the client side whenever the round starts with an integer as an argument which represents the length of the round. After, you can use getTickCount to calculate the remaning time. Edited April 30, 2017 by NeXuS™
Fist Posted April 30, 2017 Author Posted April 30, 2017 25 minutes ago, NeXuS™ said: Easily, you could trigger a starting function to the client side whenever the round starts with an integer as an argument which represents the length of the round. After, you can use getTickCount to calculate the remaning time. no need for getTickCount, there is function to get remaining time and other info about timer with getTimerDetails. + i already did that, but i thought it was possible to do this way and then code looks way cleaner which i like more but looks like it's not possible. 1 hour ago, ZoRRoM said: Where is element defined? You must use resourceRoot. setElementData(resourceRoot,...) what? Why resourceRoot? I created element dummy that i use to sync data between client and server when i need to.
Backsage Posted July 29, 2017 Posted July 29, 2017 (edited) I'm having the same problem. I have no idea how to sync a server side timer to client side. But I need to check for timer details somehow. Not sure how to do it. Edited July 29, 2017 by Backsage
Anubhav Posted July 30, 2017 Posted July 30, 2017 How about using getTimerDetails, and setting those details in a table in setElementData? Server timers are different from client sided timers Client sided timers usually depend on FPS.
Discord Moderators Pirulax Posted July 30, 2017 Discord Moderators Posted July 30, 2017 btw, just before someone tries to pass table thru setElementData: u cant.
Backsage Posted August 1, 2017 Posted August 1, 2017 (edited) Nevermind. Fixed it. I guess I just needed to move some client sided code over to server side. And I didn't need to use element data. Edited August 1, 2017 by Backsage
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