kq_wheeldamage
This section is for qb-core / qbx_core users only.
ESX users, do not need to make any changes - es_extended has these options in its vehicle properties by default.
If you're using VMS Tuning, you don't need to make the following changes - use our prepared Vehicle Properties.
qb-core
Go to your qb-core/client/functions.lua
Find function
QBCore.Functions.GetVehiclePropertiesReplace 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)
endto:
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)
endFind function
QBCore.Functions.SetVehiclePropertiesReplace below code from:
if props.tireHealth then
for wheelIndex, health in pairs(props.tireHealth) do
SetVehicleWheelHealth(vehicle, wheelIndex, health)
end
endto:
if props.tireHealth then
for wheelIndex, health in pairs(props.tireHealth) do
SetVehicleWheelHealth(vehicle, tonumber(wheelIndex), health)
end
endqbx_core
Go to your qbx_core/bridge/qb/client/functions.lua
Find function
functions.GetVehiclePropertiesReplace 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
endto:
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
endFind function
functions.SetVehiclePropertiesReplace below code from:
if props.tireHealth and not props.tyres then
for wheelIndex, health in pairs(props.tireHealth) do
SetVehicleWheelHealth(vehicle, wheelIndex, health)
end
endif (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
endto:
if props.tireHealth and not props.tyres then
for wheelIndex, health in pairs(props.tireHealth) do
SetVehicleWheelHealth(vehicle, tonumber(wheelIndex), health)
end
endif (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
endGo to your ox_lib/resource/vehicleProperties/client.lua
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
endto:
for i = 0, 7 do
if IsVehicleTyreBurst(vehicle, i, false) then
damage.tyres[tostring(i)] = IsVehicleTyreBurst(vehicle, i, true) and 2 or 1
end
endLast updated
Was this helpful?