fivem icon indicating copy to clipboard operation
fivem copied to clipboard

Crashing players when parachuting into a vehicle

Open zNexTHN opened this issue 2 years ago • 7 comments

What happened?

Crashing players when parachuting into a vehicle

Code:

CreateThread(function() local ruiner2_model = GetHashKey("ruiner2") local freemode_model = GetEntityModel(PlayerPedId())

while not HasModelLoaded(ruiner2_model) or not HasModelLoaded(freemode_model) do
    RequestModel(ruiner2_model)
    RequestModel(freemode_model)
    Wait(0)
end

local x, y, z = table.unpack(GetEntityCoords(PlayerPedId()))
local veh = CreateVehicle(ruiner2_model, x, y, z + 250.0, 0.0, true, true)

NetworkRegisterEntityAsNetworked(veh)
SetVehRadioStation(veh, "OFF")
SetModelAsNoLongerNeeded(ruiner2_model)

local ped = CreatePed(26, GetEntityModel(PlayerPedId()), 0.0, 0.0, 0.0, 0, false, false)

SetEntityVisible(ped, false)
SetEntityVisible(veh, false, 0)
SetEntityCollision(veh, false)
SetPedIntoVehicle(ped, veh, -1)

Wait(200)

NetworkRequestControlOfEntity(veh)
NetworkRegisterEntityAsNetworked(veh)
SetVehicleParachuteActive(veh, true)
SetVehicleParachuteModel(veh, GetHashKey("proc_brittlebush_01"))

Wait(3500)

DeleteEntity(veh)
DeleteEntity(ped)

end)

Expected result

Only show the parachute if it is supported by the vehicle and if it is not supported just cancel or ignore it instead of crashing surrounding players.

Reproduction steps

  1. I tested creating the vehicle normally, nothing happened!
  2. After that, I set the parachute to the vehicle and everyone around the vehicle that was created crashed.
  3. I redid the tests and it only occurred when using the parachute in the native SetVehicleParachuteModel and SetVehicleParachuteActive

Importancy

Crash

Area(s)

FiveM, Natives

Specific version(s)

FiveM

Additional information

Crashing players when parachuting into a vehicle

zNexTHN avatar Nov 13 '24 13:11 zNexTHN

This crash should already get handled by: https://github.com/citizenfx/fivem/blob/4f7d5faba4a7dd1e4c24c6b0d8eb0974fa9cfb96/code/components/gta-core-five/src/CrashFixes.FakeParachuteProp.cpp

On what gamebuild are you running?

tens0rfl0w avatar Nov 17 '24 23:11 tens0rfl0w

i have the same problem with gamebuild 3095

usershhh avatar Nov 24 '24 19:11 usershhh

Please provide a crashdump, trying to replicate this crash with the provided example code above wasn't successful.

tens0rfl0w avatar Nov 24 '24 19:11 tens0rfl0w

This crash should already get handled by: https://github.com/citizenfx/fivem/blob/4f7d5faba4a7dd1e4c24c6b0d8eb0974fa9cfb96/code/components/gta-core-five/src/CrashFixes.FakeParachuteProp.cpp

On what gamebuild are you running?

IIRC there is another crash related to that but for vehicles, i think i have a repro and fixing steps, just haven't been able to report it yet

slashkeyvalue avatar Nov 24 '24 19:11 slashkeyvalue

CfxCrashDump_2024_11_25_16_43_11.zip Here is an example of a customer crash

usershhh avatar Nov 25 '24 16:11 usershhh

This crash should already get handled by: https://github.com/citizenfx/fivem/blob/4f7d5faba4a7dd1e4c24c6b0d8eb0974fa9cfb96/code/components/gta-core-five/src/CrashFixes.FakeParachuteProp.cpp

On what gamebuild are you running?

Update: I think the fix only applies to car entities, but the exploit uses car object entities (spawn an object with the hash of a vehicle).

usershhh avatar Nov 25 '24 19:11 usershhh

See #2961

slashkeyvalue avatar Nov 25 '24 20:11 slashkeyvalue