kq_wheeldamage

qb-core
  1. Go to your qb-core/client/functions.lua

  2. Find function QBCore.Functions.GetVehicleProperties

  3. Replace below code from:

local tireHealth = {}
for i = 0, 3 do
    tireHealth[i] = GetVehicleWheelHealth(vehicle, i)
end

local tireBurstState = {}
for i = 0, 5 do
    tireBurstState[i] = IsVehicleTyreBurst(vehicle, i, false)
end

local tireBurstCompletely = {}
for i = 0, 5 do
    tireBurstCompletely[i] = IsVehicleTyreBurst(vehicle, i, true)
end

to:

local tireHealth = {}
for i = 0, 3 do
    tireHealth[tostring(i)] = GetVehicleWheelHealth(vehicle, i)
end

local tireBurstState = {}
for i = 0, 5 do
    tireBurstState[tostring(i)] = IsVehicleTyreBurst(vehicle, i, false)
end

local tireBurstCompletely = {}
for i = 0, 5 do
    tireBurstCompletely[tostring(i)] = IsVehicleTyreBurst(vehicle, i, true)
end

  1. Find function QBCore.Functions.SetVehicleProperties

  2. Replace below code from:

if props.tireHealth then
    for wheelIndex, health in pairs(props.tireHealth) do
        SetVehicleWheelHealth(vehicle, wheelIndex, health)
    end
end

to:

if props.tireHealth then
    for wheelIndex, health in pairs(props.tireHealth) do
        SetVehicleWheelHealth(vehicle, tonumber(wheelIndex), health)
    end
end
qbx_core
  1. Go to your qbx_core/bridge/qb/client/functions.lua

  2. Find function functions.GetVehicleProperties

  3. Replace below code from:

local tireHealth = {}
for i = 0, 3 do
    tireHealth[i] = GetVehicleWheelHealth(vehicle, i)
end

local tireBurstState = {}
local tireBurstCompletely = {}

for i = 0, 7 do
    local damage = props.tyres[i]
    tireBurstState[i] = damage == 1 or damage == 2
    tireBurstCompletely[i] = damage == 2
end

to:

local tireHealth = {}
for i = 0, 3 do
    tireHealth[tostring(i)] = GetVehicleWheelHealth(vehicle, i)
end

local tireBurstState = {}
local tireBurstCompletely = {}

for i = 0, 7 do
    local damage = props.tyres[i]
    tireBurstState[tostring(i)] = damage == 1 or damage == 2
    tireBurstCompletely[tostring(i)] = damage == 2
end

  1. Find function functions.SetVehicleProperties

  2. Replace below code from:

if props.tireHealth and not props.tyres then
    for wheelIndex, health in pairs(props.tireHealth) do
        SetVehicleWheelHealth(vehicle, wheelIndex, health)
    end
end
if (props.tireBurstCompletely or props.tireBurstState) and not props.tyres then
    props.tyres = {}
    for i = 0, 7 do
        props.tyres[i] = props.tireBurstCompletely and props.tireBurstCompletely[i] and 2 or props.tireBurstState and props.tireBurstState[i] and 1 or nil
    end
end

to:

if props.tireHealth and not props.tyres then
    for wheelIndex, health in pairs(props.tireHealth) do
        SetVehicleWheelHealth(vehicle, tonumber(wheelIndex), health)
    end
end
if (props.tireBurstCompletely or props.tireBurstState) and not props.tyres then
    props.tyres = {}
    for i = 0, 7 do
        props.tyres[tostring(i)] = props.tireBurstCompletely and props.tireBurstCompletely[tostring(i)] and 2 or props.tireBurstState and props.tireBurstState[tostring(i)] and 1 or nil
    end
end

  1. Go to your ox_lib/resource/vehicleProperties/client.lua

  2. Replace below code from:

for i = 0, 7 do
    if IsVehicleTyreBurst(vehicle, i, false) then
        damage.tyres[i] = IsVehicleTyreBurst(vehicle, i, true) and 2 or 1
    end
end

to:

for i = 0, 7 do
    if IsVehicleTyreBurst(vehicle, i, false) then
        damage.tyres[tostring(i)] = IsVehicleTyreBurst(vehicle, i, true) and 2 or 1
    end
end

Last updated

Was this helpful?