Jump to content

getTickCount Server - Client


'LinKin

Recommended Posts

Posted

Hello,

Does the number returned by getTickCount differs between server and client?

I mean, for example:

I have this client side

addEvent("onClientStartRecordDistance", true)

addEventHandler("onClientStartRecordDistance", root,

function()

myX, myY, myZ = getElementPosition(getPedOccupiedVehicle(localPlayer))

local startTime = getTickCount()

setElementData(localPlayer, "startTime", startTime)

addEventHandler("onClientRender", root , recordDistance)

end)

addEvent("onClientStopRecordDistance", true)

addEventHandler("onClientStopRecordDistance", root,

function()

local endTime = getTickCount()

setElementData(localPlayer, "endTime", endTime)

removeEventHandler("onClientRender", root , recordDistance)

end)

and serverside

addEventHandler("onPlayerQuit", root,

function()

triggerClientEvent(source, "onClientStopRecordDistance", source)

end)

But, the event is not triggered, I guess it is because the Client file stops existing when he quits.

So I want to know if I can set these variables startTime and endTime serverside. Would the number returned by getTickCount() be the same server and client side?

Need a clanwar script? Click here!

Do you want some free scripts for your DD server? Visit my website.

Posted

No, they are different.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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