Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-side setElementPosition syncs for server-side vehicles #3389

Closed
1 task done
srslyyyy opened this issue May 14, 2024 · 0 comments · Fixed by #3391
Closed
1 task done

Client-side setElementPosition syncs for server-side vehicles #3389

srslyyyy opened this issue May 14, 2024 · 0 comments · Fixed by #3391
Labels
bug Something isn't working

Comments

@srslyyyy
Copy link
Contributor

srslyyyy commented May 14, 2024

Describe the bug

As in title, it doesn't happen for other element types. It doesn't account whether player is syncer of vehicle. The way to prevent it is to use:

setElementSyncer(vehicleElement, false, true)

And set syncer manually when needed.

Steps to reproduce

-- server

local vehicleElement = createVehicle(434, 0, 0, 3)

setElementID(vehicleElement, "testVeh")

function checkVehiclePosition()
	local vehX, vehY, vehZ = getElementPosition(vehicleElement)

	iprint(vehX, vehY, vehZ)
end
setTimer(checkVehiclePosition, 500, 0)

-- client

local playerX, playerY, playerZ = getElementPosition(localPlayer)
local vehicleElement = getElementByID("testVeh")

setElementPosition(vehicleElement, playerX, playerY, playerZ)

Version

Multi Theft Auto v1.6-release-22390

Additional context

Ideally, it shouldn't affect server created vehicles at all. At the very least it should be limited to syncer only.

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant