If loading a networked anim scene, the following will not work with onesync enabled.
local animscene = Citizen.InvokeNative(0x1FCA98E33C1437B3, "script@shows@cancan_dance@CanCanDanceP1", 2, "PB_MAIN", true, true)
_IsAnimSceneLoaded = function(animscene)
return Citizen.InvokeNative(0x477122B8D05E7968, animscene, true, false)
--return Citizen.InvokeNative(0x477122B8D05E7968, animscene, false, false)
end
print('LoadAnimScene(animscene)')
LoadAnimScene(animscene)
while not _IsAnimSceneLoaded(animscene) do Citizen.Wait(10) end
print('LOADED')
The above code works with onesync disabled and the anim scene is networked between clients. In order for it to load with onesync, we have to pass p1 and p2 as false, however the animations are teleported.
Scenario:
Player 1: Seeās the can can dancers dancing around stage in st.denis.
Player 2: Sees the dancers but they are teleported around stage and not doing any movement.
Sadly this issue canāt be easily fixed. Itās behind well known head ache stuff called āarray handlersā. Some attempts to research array handlers was done in FiveM, this might help. But still donāt expect it to be fixed anytime soon
The reason why _IS_ANIM_SCENE_LOADED never return true when 2-nd arg is true is because 2-nd arg is basically āis all players prepared animsceneā check which uses array handler.
A small update, I backported some array handlers code from FiveM and it seems it kinda works for simple array handlers like WORLD_DOORS. But animscenes code is a bit weird. Thereās an array of array handlers and we have to research this, there wasnāt such ācasesā in V.
Iām not going to play in these Ńhinese whispers. If you know someone who can help, ask if they could help yourself. RedM is an open source project, everyone can contribute. I removed your email address just because of security measures.