Jump to content

How to pass server Timer to client ?


Fist

Recommended Posts

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?

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

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 by NeXuS™
Link to comment
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.

Link to comment
  • 2 months later...

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