[OneSync] GetEntityCoords wrong serverside coords while staying on top of the car

Before continuing, please make sure that your issue/crash has not been filed before on this forum. If it has, please provide additional information in the existing forum topic by filling out the template there.

To provide valuable feedback for OneSync issues or crashes, please fill out the following template as much as possible.

Client

Using canary? No
Windows version: Windows 10 - 1903

Server

Operating system: Windows 10 - 1903
Artifact version: 2802
IP address: localhost

Incident

Summary:
I use serverside RPC GetEntityCoords for saving players position to DB and noticed that I get wrong positions when player stand on top of the car.

Expected behavior:
A correct return from GetEntityCoords RPC.

Actual behavior:
Wrong return from GetEntityCoords RPC compared to clienside GetEntityCoords.

Steps to reproduce:

  1. Stand still on the ground (coords displays correctly from serverside).
  2. Climb on top of any car (wrong coords from serverside)

Server/Client? Server

Files for repro (if any):
You can use simple script and watch console results:

-- Client script

RegisterNetEvent("repro:position")
AddEventHandler("repro:position", function(serverPos)
	local ped = PlayerPedId()
	local pos = GetEntityCoords(ped)

	print(('Client: %s; Server: %s'):format(pos, serverPos))
end)
-- Server script

Citizen.CreateThread(function()
  while true do
    Wait(1000)

    for _, playerId in ipairs(GetPlayers()) do
      local ped = GetPlayerPed(playerId)
      local pos = GetEntityCoords(ped)

      TriggerClientEvent("repro:position", playerId, pos)
    end
  end
end)
function(serverPos)

Fixed :slightly_smiling_face:

2 Likes