[EN/FR] Broken cars

For the moment, simply disable the engine’s health parameters and problem solved.

HAs there been an actual fix to this? Kind of ruins the whole job having to disable the damage

After many headaches trying to fix this i finally did it!

Replace the CustomVehicleDommage function in the mecano_client.lua with this:

local function CustomVehicleDommage()
    local myPed = GetPlayerPed(-1)
    local vehicle = GetVehiclePedIsIn(myPed, 0)
    if vehicle ~= 0 then 
        local engineHealth = GetVehicleEngineHealth(vehicle)
        local vehicleHealth = GetEntityHealth(vehicle)
        local petrolTankeHealth = GetVehiclePetrolTankHealth(vehicle)
        local vehicleHealth2 = GetVehicleBodyHealth_2(vehicle)
--Remove This part of the code to remove the Debug info displayed in the screen.    
        ClearPrints()
        SetTextEntry_2("STRING")
        AddTextComponentString('~r~' .. math.floor(engineHealth) .. ' ~g~ ' .. vehicleHealth .. ' ~b~ ' .. math.floor(petrolTankeHealth) .. '\n~y~' .. vehicleHealth2 .. '\n~o~')
        DrawSubtitleTimed(200, 1)
--------------------------------------------------------------------------------
        if engineHealth <= 400 then
            SetVehicleEngineTorqueMultiplier(vehicle,0.4)
            SetVehicleIndicatorLights(vehicle, 0, true)
            SetVehicleIndicatorLights(vehicle, 1, true)
        end

        if engineHealth <= 300 then
            SetVehicleEngineTorqueMultiplier(vehicle,0.09)
            SetVehicleEngineHealth(vehicle, 150.0)
            SetVehicleBodyHealth(0.0)
            SetVehicleUndriveable(vehicle, true)
            SetVehicleDoorOpen(vehicle, 4, 0, 0)
            SetVehicleIndicatorLights(vehicle, 0, true)
            SetVehicleIndicatorLights(vehicle, 1, true)
        end

        if vehicleHealth <= 700 then
            SetVehicleEngineTorqueMultiplier(vehicle,0.09)
            SetVehicleEngineHealth(vehicle, 150.0)
            SetVehicleBodyHealth(0.0)
            SetVehicleUndriveable(vehicle, true)
            SetVehicleDoorOpen(vehicle, 4, 0, 0)
            SetVehicleIndicatorLights(vehicle, 0, true)
            SetVehicleIndicatorLights(vehicle, 1, true)
        end

        if petrolTankeHealth <= 700 then
            SetVehicleEngineTorqueMultiplier(vehicle,0.09)
            SetVehicleEngineHealth(vehicle, 150.0)
            SetVehicleBodyHealth(0.0)
            SetVehicleUndriveable(vehicle, true)
            SetVehicleDoorOpen(vehicle, 4, 0, 0)
            SetVehicleIndicatorLights(vehicle, 0, true)
            SetVehicleIndicatorLights(vehicle, 1, true)
        end
    end
end
2 Likes

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