[Native] What's the native used to get/set vehicle VISUAL damage?

^ Title.

I’ve seen some but I’m not sure, anyone knows?

Everything you need is on: Native Reference - Cfx.re Docs

Probably theses one you’re looking for:

1 Like

i am also looking for such function but i was only able to find one to copy its visual damage

1 Like

I use this when i need to check thing with vehicle damage and so :slight_smile:

function DrawText3Ds2(x, y, z, text)
    local onScreen,_x,_y=World3dToScreen2d(x,y,z)
    local px,py,pz=table.unpack(GetGameplayCamCoords())
    
    SetTextScale(0.45, 0.45)
    SetTextFont(6)
    SetTextProportional(1)
    SetTextColour(255, 255, 255, 215)
    SetTextEntry("STRING")
    SetTextCentre(1)
    AddTextComponentString(text)
    DrawText(_x,_y)
    local factor = (string.len(text)) / 370
    DrawRect(_x,_y+0.0125, 0.015+ factor, 0.03, 41, 11, 41, 68)
end
-------------------------------------------------------------

Citizen.CreateThread(function()
    while true do
    	Citizen.Wait(0)
		veheng = GetVehicleEngineHealth(GetVehiclePedIsUsing(PlayerPedId()))
		vehbody = GetVehicleBodyHealth(GetVehiclePedIsUsing(PlayerPedId()))
        vehclue = GetVehicleClutch(GetVehiclePedIsUsing(PlayerPedId()))
		local Coords  = GetEntityCoords(PlayerPedId())
		if IsPedInAnyVehicle(PlayerPedId(), 1) then
			vehenground = tonumber(string.format("%.2f", veheng))
			vehbodround = tonumber(string.format("%.2f", vehbody))
            vehcleround = tonumber(string.format("%.2f", vehclue))
			if IsControlPressed(0, 32) then
			DrawText3Ds2(Coords.x, Coords.y, Coords.z+1.0, "HP : "..vehenground)
            DrawText3Ds2(Coords.x, Coords.y, Coords.z+1.2, "BHP : "..vehbodround)
            DrawText3Ds2(Coords.x, Coords.y, Coords.z+1.4, "CHP : "..vehcleround)
			end

end
    end
end)

he even wrote VISUAL in all caps so im pretty sure he means something like where dents are located

have you seen ?..

2 Likes

I wonder if X, Y, Z parameters are for a certain area of the vehicle?

Maybe this is the thing I’m looking for? Will test in a little bit, thanks!?

I’ve seen that but I don’t think that’s what I’m looking for tho, I mean VISUAL damage and I’m pretty sure those don’t set visual damage