FiveM crashing when created ped enters vehicle

I’m not really sure which forum category this issue should reside in.
I’ve come as far in my own fault tracing to conclude that this is a one-sync error.
The crash is verified to occur for other users as well as well as on another server(both windows and linux)

When I create a ped in my script(on my own server) and sets it to enter a car, the game will crash at the very moment the ped enters the drivers seat.
The game does not crash when the ped enters any other seat.
The game does not crash when one-sync is turned off

The code snippet used to produce the error:

    local model = "a_m_m_acult_01"
	local pPos = GetEntityCoords(PlayerPedId())
	local hash = GetHashKey(model)

    -- Loads model
    RequestModel(hash)
    while not HasModelLoaded(hash) do
    	Citizen.Wait(1)
	end
	local ped = CreatePed(4, hash, pPos.x, pPos.y+1, pPos.z, 0, false, false)
	SetModelAsNoLongerNeeded(hash)
	SetEntityAsMissionEntity(ped)

	local vehicleName = 'blista'
	RequestModel(vehicleName)
	
	while not HasModelLoaded(vehicleName) do
		Wait(500)
	end
	local vehicle = CreateVehicle(vehicleName, pPos.x, pPos.y+5, pPos.z, GetEntityHeading(PlayerPedId()), true, false)
	SetModelAsNoLongerNeeded(vehicleName)
	TaskWarpPedIntoVehicle(ped, vehicle, 0)

CfxCrashDump_2020_06_30_19_51_14.zip (1.2 MB)

Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.

Please note that most of the support is provided by the Cfx.re community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.

To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.

Thanks for keeping these forums tidy!
:mascot:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.