qbcore-framework / qb-garages

Garage System Used With QB-Core :car:
GNU General Public License v3.0
48 stars 259 forks source link

[BUG] Damage does not save #299

Closed Jamie-Blake closed 10 months ago

Jamie-Blake commented 1 year ago

Whenever I put a vehicle into any of the garages when it is damaged, and then take it out again the damage does not save.

Steps to reproduce the behaviour:

  1. Go to any garage and store a vehicle you own that is damaged
  2. Click on the garage menu and spawn your car in
  3. Once out there is no damage

Expected behaviour When a car with damage is put in to the garage it should come out looking the same

Questions (please complete the following information):

I have attached a screenshot of the error i am getting in the console. image

github-actions[bot] commented 11 months ago

This issue has had 60 days of inactivity & will close within 7 days

GrumpyFinster commented 11 months ago

replace this in your qb-vehiclefailure client.lua

local function DamageRandomComponent()

end

if healthEngineNew ~= healthEngineCurrent then SetVehicleEngineHealth(vehicle, healthEngineNew) local dmgFactr = (healthEngineCurrent - healthEngineNew) if dmgFactr > 0.8 then DamageRandomComponent() end end

if healthBodyNew ~= healthBodyCurrent then SetVehicleBodyHealth(vehicle, healthBodyNew) DamageRandomComponent() end

if healthPetrolTankNew ~= healthPetrolTankCurrent then SetVehiclePetrolTankHealth(vehicle, healthPetrolTankNew) end

also download and replace qb-garages with this

https://github.com/JonasDev17/qb-garages