OneSync GetEntityCoords Returning Wrong Coords

Client

Using canary? No
Windows version: Version 10.0.18362 Build 18362

Server

Artifact version: 2625
IP address: Hosted on same PC as the client
Resources: Standard server.cfg with a testing resource to get coords from a command.

Incident

Summary:
I wanted to create a simple vehicle spawner when I noticed that the server was getting some wrong coords when using GetEntityCoords.

Expected behavior:
A consistent correct return from GetEntityCoords.

Actual behavior:
A wrong return from GetEntityCoords after the server has been restarted with the client on it.

Steps to reproduce:
1: Start your server, and join from your client. (Here coords displays correctly!)
2: Close the server while the client is on the server (Sometimes you need to do this step twice for it to work)
3: Open the server again, and rejoin from your client (Coords are now returning -27648, -27648, -1700 )

Restarting the client seems to fix it after you encounter this issue.

Server/Client?
Server.

Script Used:
Run the following on the server

RegisterCommand('getpos', function(source, args, command)
    local playerId = source
    local ped = GetPlayerPed(playerId)

    print(GetEntityCoords(ped))
end)

Any additional info:
You might need to restart the server a few times with the client on it to trigger it, but I was able to consistently reproduce this doing these steps.

1 Like

try running it on client. think it needs to be client.

No. On OneSync servers you can run this function on the server, please refer to the native reference:

1 Like

Im getting these same coords.

1 Like

Had the same issue, getting the same coords

Am I correct in that, if this occurs, moving at least ~200 units in-game after spawning will make coordinates correct again?

You’re correct, I just went in-game and tested it, coords returned to expected outcome after moving ~200 units away from my spawn.

OK, that does match my results then. Likely some behavior with a clone update not being acknowledged correctly.

1 Like