Currently coming across the issue that pausing an animation does not function entirely.
on my client it freezes perfectly, yet on another client it will play the entire animation, then stop and clear ped task. Any idea what might be causing that, or how to sync it?
I borrowed part of the code from negbook from his forum topic
My code:
RegisterNetEvent("AnimTest")
AddEventHandler("AnimTest", function()
local lib = 'jh_2_arrest_fail_c-3'
local anim = 's_m_y_cop_01^4_dual-3'
local pos = GetEntityCoords(PlayerPedId())
local rot = GetEntityRotation(PlayerPedId())
RequestAnimDict(lib)
while not HasAnimDictLoaded(lib) do
Citizen.Wait(1)
end
TaskPlayAnimAdvanced(PlayerPedId(), lib, anim, pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, 1.0, 1.0, -1, 50, 0.99, 0, 0, 0)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if (IsEntityPlayingAnim(PlayerPedId(), lib, anim, 3)) then
SetEntityAnimCurrentTime(PlayerPedId(), lib, anim, 0.99);
SetEntityAnimSpeed(PlayerPedId(), lib, anim, 0);
end
end
end)
end)