Skip to content

exports

Client-side exports for integrating with other resources.

FullyRepairVehicle#

Fully repairs a specific vehicle — body, engine, fuel tank, all tires, wheel state, and active leaks.

lua
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
local success = exports['s4-wheeldamage']:FullyRepairVehicle(vehicle)
ParameterTypeDescription
vehiclenumberVehicle entity handle

Returns: boolean — true if repair succeeded, false if vehicle is invalid.

What it does#

  • Calls SetVehicleFixed, SetVehicleDeformationFixed
  • Sets engine, body, and petrol tank health to 1000
  • Fixes all tire indices (0–7)
  • Clears Cars state (damaged tires, wheel collider sizes)
  • Stops active leak tasks
  • Syncs state to server via syncCars

FullyRepairCurrentVehicle#

Same as above, but automatically uses the player's current vehicle.

lua
local success = exports['s4-wheeldamage']:FullyRepairCurrentVehicle()

Returns: boolean

Usage examples#

Mechanic job integration#

lua
RegisterNetEvent('my-mechanic:client:repair', function()
    exports['s4-wheeldamage']:FullyRepairCurrentVehicle()
end)

Target-based repair#

lua
exports.ox_target:addGlobalVehicle({
    {
        name = 'full_repair',
        label = 'Full Repair',
        icon = 'fa-wrench',
        onSelect = function(data)
            exports['s4-wheeldamage']:FullyRepairVehicle(data.entity)
        end,
    },
})

Server-triggered repair#

lua
-- server.lua
RegisterNetEvent('myresource:repairVehicle', function(netId)
    local vehicle = NetworkGetEntityFromNetworkId(netId)
    TriggerClientEvent('myresource:doRepair', source, netId)
end)

-- client.lua
RegisterNetEvent('myresource:doRepair', function(netId)
    local vehicle = NetworkGetEntityFromNetworkId(netId)
    exports['s4-wheeldamage']:FullyRepairVehicle(vehicle)
end)

Built-in compatibility#

If Config.EnableCompatible = true, the script automatically listens for common mechanic repair events and calls FullyRepairVehicle. See Mechanic compatibility for the full event list.