SetPedDriveByClipsetOverride sync issue

Summary

The native SetPedDriveByClipsetOverride works to override the clipset for the client, but it does not sync between any other players. I have tried to manually sync it using client/server events but that hasn’t worked either.


Screenshots

Tested using the latest recommended version of FiveM.


(For clipset overrides, opposed to layout overrides, the animation will need editing for left handed aiming)


Code & Clipset

Press X a bunch of times until you are in the backseat, then press N and M to switch clipsets and Up Arrow to clear clipset overrides.

Make sure you have the custom clipset streamed to test.
(Overriding using a default clipset N seems to do nothing?)

Code Thread
Citizen.CreateThread(function()
	local myPed=nil
	local myVeh=0
	local seatIndex=-1
	local seatMax=0
	
	while true do
		Citizen.Wait(1)
		if not IsPauseMenuActive()  then -- ESC Menu
			myPed=GetPlayerPed(-1)

			if IsControlJustPressed(0, 73) or IsDisabledControlJustPressed(0, 73) then -- X
				GiveWeaponToPed(myPed, `WEAPON_PISTOL`, 500, false, true)
				myVeh=GetVehiclePedIsIn(myPed)
				seatMax=GetVehicleMaxNumberOfPassengers(myVeh)
				if seatIndex>seatMax then seatIndex=-1 else seatIndex=seatIndex+1 end
				
				if IsVehicleSeatFree(myVeh, -1) then
					local newPed = ClonePed(myPed, true, true, false) Wait(500)
					SetPedIntoVehicle(newPed, myVeh, -1)
				end
				if IsVehicleSeatFree(myVeh, seatIndex) then SetPedIntoVehicle(myPed, myVeh, seatIndex) end
			end
			
			DisableControlAction(0, 172, 1)
			if IsDisabledControlJustPressed(0, 172) then 
				ClearPedDriveByClipsetOverride(myPed)
			end -- Up Arrow
			
			DisableControlAction(0, 306, 1)
			if IsDisabledControlJustPressed(0, 306) then 
				RequestAnimSet("veh@drivebystd_rps")
				SetPedDriveByClipsetOverride(myPed, "veh@drivebystd_rps")
			end -- N
			
			DisableControlAction(0, 301, 1)
			if IsDisabledControlJustPressed(0, 301) then 
				RequestAnimSet("delta@drive_by@suv_ps_1h")
				SetPedDriveByClipsetOverride(myPed, "delta@drive_by@suv_ps_1h")
			end -- M
		end
	end
end)

Custom Clipset - _EDA_DEMO.zip

9 Likes

You should wait for the animation set to load using HAS_ANIM_SET_LOADED before setting the ped’s clip set override.

local animSet = 'veh@drivebystd_rps'

RequestAnimSet(animSet)

while not HasAnimSetLoaded(animSet) do
    Wait(0)
end

-- setting the ped's clip set override now should work.
1 Like

You should wait for the animation set to load using HAS_ANIM_SET_LOADED before setting the ped’s clip set override.

Yes I understand this is the best practice and I did forgot that, however this does not fix the sync issue unfortunately.

With or without HasAnimSetLoaded, it works to override the clipset for the client, but it does not sync between any other players.
Tried using client/server events but it seems that clients can’t override another player’s clipset, so that does not sync it either.

1 Like

We need a solution

1 Like

Please fix this FiveM

1 Like

Was this ever addressed? Because I’ve not had issues with movement clipsets, you unless they’re handled differently.

This is being addressed, yes. There’s some weird in-game check, researching it.

3 Likes

I’ve implemented an optional “bypass” for this in-game behavior:

4 Likes