> For the complete documentation index, see [llms.txt](https://docs.otherplanet.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otherplanet.dev/scripts/op-mechanic-v2/exports/client-side.md).

# Client Side

Client Side list of exports/events

{% hint style="warning" %}
Missing an export? Contact us on our [Discord Server](https://discord.gg/otherplanet).
{% endhint %}

***

### GetVehicleProperties

Capture a full props table for garage persistence (mods, paint, neon, health, …).

```lua
local props = exports['op-mechanic']:GetVehicleProperties(vehicle)
```

* `vehicle`: `number` (entity)
* returns: `table | nil`

***

### SetVehicleProperties

Apply a props table. Default uses a reliable multi-pass apply.

```lua
exports['op-mechanic']:SetVehicleProperties(vehicle, props)
exports['op-mechanic']:SetVehicleProperties(vehicle, props, false) -- single pass
```

* `vehicle`: `number`
* `props`: `table`
* `reliable`: `boolean?` (`true` default)
* returns: `boolean`

***

### OpenTuning / CloseTuning / IsTuningOpen

```lua
exports['op-mechanic']:OpenTuning(vehicle)   -- optional vehicle; otherwise closest
exports['op-mechanic']:CloseTuning(restore)  -- restore snapshot when true (default)
local open = exports['op-mechanic']:IsTuningOpen()
```

***

### OpenTablet / CloseTablet

```lua
exports['op-mechanic']:OpenTablet()
exports['op-mechanic']:CloseTablet()
```

Useful for radial menus or custom item handlers. Prefer inventory export `useMechanicTablet` when using `mechanic_tablet`.

***

### GetVehicleMileage

Live mileage for HUDs. Reads state bag.

```lua
local data = exports['op-mechanic']:GetVehicleMileage(vehicle)
-- { plate, mileageKm, odometer, odometerUnit, synced } | nil
```

```lua
CreateThread(function()
    while true do
        local ped = PlayerPedId()
        if IsPedInAnyVehicle(ped, false) then
            local veh = GetVehiclePedIsIn(ped, false)
            local m = exports['op-mechanic']:GetVehicleMileage(veh)
            if m then
                -- string.format('%.0f %s', m.odometer, m.odometerUnit)
            end
            Wait(200)
        else
            Wait(1000)
        end
    end
end)
```

***

### EnsureVehicleMileage

If the state bag is missing, loads DB mileage.

```lua
local data = exports['op-mechanic']:EnsureVehicleMileage(vehicle)
```

***

### Nitro Exports

Get nitro state and all required data to connect it to your hud.

```lua
exports['op-mechanic']:GetNitro(vehicle?)       
exports['op-mechanic']:GetNitroLevel(vehicle?)  
exports['op-mechanic']:IsNitroBoosting(vehicle?)
exports['op-mechanic']:IsNitroPurging(vehicle?)
exports['op-mechanic']:IsNitroHudEnabled()
```

### Item exports (inventory)

Used from inventory item definitions:

```lua
exports['op-mechanic']:useMechanicTablet()
exports['op-mechanic']:useRgbController()
exports['op-mechanic']:useEngineKit()
exports['op-mechanic']:useBodyKit()
exports['op-mechanic']:useCleaningKit()
exports['op-mechanic']:useCarWax()
exports['op-mechanic']:usePlaceable(data, slot)
```

### **Kit unlock items (Tebex / item shops)**

When `Config.Nitro.requireInstallItem` / `Config.AntiLag.requireInstallItem` is `true`, players **use** the kit on the vehicle to **unlock** mounting in the tuning menu. The item does **not** fit the kit by itself - install still happens in tuning (pay / work order).

```lua
exports['op-mechanic']:useNitroKitUnlock()     -- nitrous_install_kit
exports['op-mechanic']:useAntiLagKitUnlock()  -- antilag_install_kit
```

{% hint style="info" %}
Full setup: Require nitro & anti-lag install item.
{% endhint %}

**ox\_inventory example**

```lua
['nitrous_install_kit'] = {
    label = 'Nitrous Install Kit',
    weight = 1200,
    stack = true,
    close = true,
    description = 'Use on a vehicle to unlock nitro kit install in the tuning menu.',
    client = {
        export = 'op-mechanic.useNitroKitUnlock',
    },
},

['antilag_install_kit'] = {
    label = 'Anti-lag Install Kit',
    weight = 1000,
    stack = true,
    close = true,
    description = 'Use on a vehicle to unlock anti-lag install in the tuning menu.',
    client = {
        export = 'op-mechanic.useAntiLagKitUnlock',
    },
},
```

Framework usable registration is also handled automatically by the resource when `requireInstallItem = true` (ESX / QB / Qbox via `Fr.RegisterUsableItem`).
