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