# Exports

All exports are accessible via `exports.rm_3dtuning:<name>(...)`.

***

### Client Exports

#### `getNitroData(plate)`

Returns current client-side nitrous state for the given vehicle plate.

**Parameters**

| Name    | Type     | Description                              |
| ------- | -------- | ---------------------------------------- |
| `plate` | `string` | Vehicle plate (auto-trimmed internally). |

**Returns**

| Type           | Description                                               |
| -------------- | --------------------------------------------------------- |
| `table \| nil` | Nitrous state object, or `nil` if vehicle has no nitrous. |

**Return shape**

| Field         | Type                 | Description                                          |
| ------------- | -------------------- | ---------------------------------------------------- |
| `hasnitro`    | `boolean`            | `true` when at least one tank is installed.          |
| `tanks`       | `integer`            | Total number of installed tanks.                     |
| `tankLevels`  | `table<int, number>` | 1-indexed map, each entry `0–100` (percent drained). |
| `currentTank` | `integer`            | Index of the tank currently being consumed.          |

**Example**

```lua
local data = exports.rm_3dtuning:getNitroData('ABC1234')
if data and data.hasnitro then
    print(('tanks=%d currentTank=%d'):format(data.tanks, data.currentTank))
end
```

***

#### `isNitroActive()`

Returns whether the local player is actively holding the nitrous activation key right now.

**Parameters** — none.

**Returns**

| Type      | Description                             |
| --------- | --------------------------------------- |
| `boolean` | `true` while nitrous is being consumed. |

***

#### `getVehicleFeatures(plate)`

Returns the tablet menu toggle states for the given vehicle.

**Parameters**

| Name    | Type     | Description    |
| ------- | -------- | -------------- |
| `plate` | `string` | Vehicle plate. |

**Returns**

| Type    | Description             |
| ------- | ----------------------- |
| `table` | Feature-to-boolean map. |

**Return shape** (all fields are `boolean`)

| Field              | Description                   |
| ------------------ | ----------------------------- |
| `nitrous`          | Nitrous enabled.              |
| `purge`            | Purge enabled.                |
| `popcorn`          | Popcorn backfire enabled.     |
| `glow`             | Glowing brake discs enabled.  |
| `drift`            | Drift+ mode enabled.          |
| `drift_hd`         | Drift HD mode enabled.        |
| `smoke`            | Drift smoke enabled.          |
| `sport_mode`       | Sport mode enabled.           |
| `throttle_control` | Throttle control enabled.     |
| `rollback`         | Rollback & handbrake enabled. |
| `neon`             | Neon lights enabled.          |
| `interior_lights`  | Interior lights enabled.      |
| `shunt`            | Shunt boost enabled.          |

***

#### `getCurrentVehicleFeatures()`

Returns the tablet feature toggles of the vehicle the local player is currently inside.

**Parameters** — none.

**Returns**

| Type    | Description                                                                                                                 |
| ------- | --------------------------------------------------------------------------------------------------------------------------- |
| `table` | Same shape as [`getVehicleFeatures`](https://docs.rainmad.com/resources/3d-tuning-tablet/exports#getvehiclefeatures-plate). |

***

#### `getCurrentExhaust()`

Returns custom exhaust data for the vehicle the local player is currently inside.

**Parameters** — none.

**Returns**

| Type           | Description                                                                      |
| -------------- | -------------------------------------------------------------------------------- |
| `table \| nil` | Exhaust data, or `nil` if not inside a vehicle or vehicle has no custom exhaust. |

**Return shape**

| Field   | Type      | Description                            |
| ------- | --------- | -------------------------------------- |
| `color` | `integer` | Selected flame color index (`0–12`).   |
| `sound` | `boolean` | Whether the backfire sound is enabled. |

***

### Server Exports

#### `getNitroData(plate)`

Returns the server-side cached nitrous record for the given plate.

**Parameters**

| Name    | Type     | Description    |
| ------- | -------- | -------------- |
| `plate` | `string` | Vehicle plate. |

**Returns**

| Type           | Description                                         |
| -------------- | --------------------------------------------------- |
| `table \| nil` | Cached record, or `nil` if no nitrous is installed. |

**Return shape**

| Field        | Type      | Description                                                          |
| ------------ | --------- | -------------------------------------------------------------------- |
| `hasnitro`   | `boolean` | Always `true` when a record is returned.                             |
| `nos_level`  | `number`  | Current tank drain level (`0–100`, percent drained of current tank). |
| `nos_bottle` | `integer` | Total installed tanks.                                               |
| `color`      | `integer` | Selected particle flame color index (`0–12`).                        |

***

#### `hasTablet(plate)`

Checks whether the given vehicle has a tablet installed.

**Parameters**

| Name    | Type     | Description    |
| ------- | -------- | -------------- |
| `plate` | `string` | Vehicle plate. |

**Returns**

| Type      | Description                       |
| --------- | --------------------------------- |
| `boolean` | `true` if a tablet record exists. |

***

#### `getTabletData(plate)`

Returns the tablet offset/rotation record for the given vehicle.

**Parameters**

| Name    | Type     | Description    |
| ------- | -------- | -------------- |
| `plate` | `string` | Vehicle plate. |

**Returns**

| Type           | Description                                         |
| -------------- | --------------------------------------------------- |
| `table \| nil` | Tablet placement record, or `nil` if not installed. |

**Return shape**

| Field      | Type      | Description                           |
| ---------- | --------- | ------------------------------------- |
| `offset`   | `vector3` | Local offset from the vehicle origin. |
| `rotation` | `vector3` | Local rotation (pitch, roll, yaw).    |

***

#### `hasExhaust(plate)`

Checks whether the given vehicle has a custom exhaust installed.

**Parameters**

| Name    | Type     | Description    |
| ------- | -------- | -------------- |
| `plate` | `string` | Vehicle plate. |

**Returns**

| Type      | Description                               |
| --------- | ----------------------------------------- |
| `boolean` | `true` if a custom exhaust record exists. |

***

#### `getExhaustData(plate)`

Returns the server-side cached custom exhaust record for the given vehicle.

**Parameters**

| Name    | Type     | Description    |
| ------- | -------- | -------------- |
| `plate` | `string` | Vehicle plate. |

**Returns**

| Type           | Description                                |
| -------------- | ------------------------------------------ |
| `table \| nil` | Exhaust record, or `nil` if not installed. |

**Return shape**

| Field   | Type      | Description                            |
| ------- | --------- | -------------------------------------- |
| `color` | `integer` | Selected flame color index (`0–12`).   |
| `sound` | `boolean` | Whether the backfire sound is enabled. |

***

#### `getVehicleFeatures(plate)`

Returns the persisted tablet menu toggle states for the given vehicle.

**Parameters**

| Name    | Type     | Description    |
| ------- | -------- | -------------- |
| `plate` | `string` | Vehicle plate. |

**Returns**

| Type           | Description                                                                                                                                                                                    |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `table \| nil` | Same shape as the client [`getVehicleFeatures`](https://docs.rainmad.com/resources/3d-tuning-tablet/exports#getvehiclefeatures-plate), or `nil` if the vehicle has no saved feature state yet. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rainmad.com/resources/3d-tuning-tablet/exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
