-
-
Notifications
You must be signed in to change notification settings - Fork 503
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
There is a bug where when you spawn a ped with a certain rotation and freeze him, go away and come back, the ped resets its rotation and starts to look other direction (resets to 0).
It seems to be related to this, but I am using a update version right now and still have about the same problem.
This only happens if you use setElementFrozen immediately after spawning the ped.
Steps to reproduce
-- server
addEventHandler("onResourceStart", resourceRoot, function()
local x, y, z = unpack({ 2076.55, -1587.19, 13.48 })
local ped = createPed(4, x, y, z)
setElementRotation(ped, 0, 0, 270)
iprint("server spawn rot", getElementRotation(ped)) -- logs 0, 0, 270
setElementFrozen(ped, true) -- if you do this immediately, it will not sync correctly.
-- if you do this tho, it will work
-- setTimer(function()
-- setElementFrozen(ped, true)
-- end, 500, 1)
setPedAnimation(ped, "COP_AMBIENT", "Copbrowse_loop", -1, true, false, false, false)
setElementData(ped, "customped", true)
end)
-- client
addEventHandler("onClientElementStreamIn", root, function()
local element = source
local isPed = getElementData(element, "customped")
if isPed then
-- returns 0, 0, 0 if setElementFrozen has no delay, or 0, 0, 270 if it has
iprint("client stream rot", element, getElementRotation(element))
end
end)Version
25775 (Windows 10, 64-bit)
Additional context
No response
Relevant log output
Security Policy
- I have read and understood the Security Policy and this issue is not security related.
guibzo
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working