Applying visible damage to car body

Hey guys, i’ve been saving vehicle damage variables like

local health        = {}
    health.engine       = GetVehicleEngineHealth(vehicle)
    health.body         = GetVehicleBodyHealth(vehicle)

In my mysql base and then setting them back when players get it from the garage using

SetVehicleBodyHealth(vehicle, data.current.health.body-1)
SetVehicleEngineHealth(vehicle, data.current.health.engine-1)

Engine health works fine but body health seems to not change the vehicle appearance, i’ve checked all the natives nothing works or get close to this system. The values passed are correct i verified
Any idea ?

Hello,
I tried too to implements a feature to save BodyHealth (visible damage) but nothing work too

I tried SetVehicleDamage, but i didn’t understand how it work

1 Like

Do you mind sharing how did you implement saving the engine health, thanks in advance.

GetVehicleEngineHealth,GetVehicleBodyHealth,SetVehicleBodyHealth… Haven’t effect on visible damage, It’s some intern value define when explode or undriveable.

I’m know how to get the damage with gameevent but I never know how to use all value to apply back. If someone have some information about this to apply visible damage

https://runtime.fivem.net/doc/natives/#_0xA1DD317EA8FD4F29
void SET_VEHICLE_DAMAGE(Vehicle vehicle, float xOffset, float yOffset, float zOffset, float damage, float radius, BOOL p6)

I know this, but actually I have this and no relation with function

CEventNetworkEntityDamage
Argument → value → information about arg
1 → 1026 → Vehicule
2 → 514 → source of damage but always 514 and some time random number
3 → 1108321792 → unckonw but related to source
4 → 0 → fatal Damage
5 → 133987706 → hash weapon https://wiki.■■■■■■■■■■■/index.php?title=Weapons_Models
6 → 1090566405
7 → 1090566405
8 → 0
9 → 0
10 → 0
11 → 0