# Exports

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

***

### Client Exports

#### `isPlateHidden(vehicle)`

Returns whether the vehicle's real plate is currently hidden by an active flipper.

**Parameters**

| Name      | Type     | Description           |
| --------- | -------- | --------------------- |
| `vehicle` | `number` | Vehicle entity handle |

**Returns**

| Type      | Description                                                          |
| --------- | -------------------------------------------------------------------- |
| `boolean` | `true` if the flipper is installed and toggled on, `false` otherwise |

**Example**

```lua
if exports.rm_customplate:isPlateHidden(cache.vehicle) then
    print('plate is hidden by flipper')
end
```

***

#### `hasCustomPlate(vehicle)`

Returns whether the vehicle has any custom plate data attached (normal custom plate or flipper).

**Parameters**

| Name      | Type     | Description           |
| --------- | -------- | --------------------- |
| `vehicle` | `number` | Vehicle entity handle |

**Returns**

| Type      | Description                                                                              |
| --------- | ---------------------------------------------------------------------------------------- |
| `boolean` | `true` if the vehicle has at least one rendered plate or flipper data, `false` otherwise |

**Example**

```lua
local veh = lib.getClosestVehicle(GetEntityCoords(cache.ped), 5.0, false)
if veh and exports.rm_customplate:hasCustomPlate(veh) then
    print('this vehicle has a custom plate')
end
```

***

#### `getPlateData(vehicle)`

Returns the plate data attached to the vehicle, or `nil` if none. If a flipper is installed it is returned first; otherwise the normal plate data is read from the entity's state bag.

**Parameters**

| Name      | Type     | Description           |
| --------- | -------- | --------------------- |
| `vehicle` | `number` | Vehicle entity handle |

**Returns**

| Type           | Description                                                                                               |
| -------------- | --------------------------------------------------------------------------------------------------------- |
| `table \| nil` | Flipper data if installed, otherwise normal plate array, or `nil` if the vehicle has no custom plate data |

**Return shape**

Normal custom plate (array of plate entries):

```lua
{
    [1] = { base64 = string, offset = { x, y, z }, rotation = { x, y, z }, plateModel = string },
    [2] = { ... },  -- optional front plate
}
```

Black flipper:

```lua
{
    flip   = true,
    black  = true,
    base64 = string,
    active = boolean,
}
```

Custom flipper:

```lua
{
    flip   = true,
    active = boolean,
    plates = {
        [1] = { base64 = string, offset = { x, y, z }, rotation = { x, y, z }, plateModel = string },
        [2] = { ... },  -- optional front plate
    },
}
```

**Example**

```lua
local data = exports.rm_customplate:getPlateData(cache.vehicle)
if data then
    if data.flip then
        print(('flipper active=%s'):format(tostring(data.active)))
    else
        print(('normal plate, %d entry(ies)'):format(#data))
    end
end
```

***

### Server Exports

#### `isPlateHidden(plate)`

Returns whether the vehicle's plate is currently hidden by an active flipper.

**Parameters**

| Name    | Type     | Description                           |
| ------- | -------- | ------------------------------------- |
| `plate` | `string` | Vehicle plate text (e.g. `"ABC1234"`) |

**Returns**

| Type      | Description                                                        |
| --------- | ------------------------------------------------------------------ |
| `boolean` | `true` if a flipper is installed and toggled on, `false` otherwise |

**Example**

```lua
if exports.rm_customplate:isPlateHidden('ABC1234') then
    print('plate hidden')
end
```

***

#### `hasCustomPlate(plate)`

Returns whether the given plate has any custom plate data persisted.

**Parameters**

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

**Returns**

| Type      | Description                                                                              |
| --------- | ---------------------------------------------------------------------------------------- |
| `boolean` | `true` if the cache has data for this plate (normal plate or flipper), `false` otherwise |

**Example**

```lua
if exports.rm_customplate:hasCustomPlate('ABC1234') then
    print('this plate has custom data')
end
```

***

#### `getPlateData(plate)`

Returns the full server-side plate data record, or `nil` if no data exists for the plate.

**Parameters**

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

**Returns**

| Type           | Description                                                    |
| -------------- | -------------------------------------------------------------- |
| `table \| nil` | Plate data table, or `nil` if nothing is stored for this plate |

**Return shape**

Normal custom plate (array of plate entries):

```lua
{
    [1] = { base64 = string, offset = { x, y, z }, rotation = { x, y, z }, plateModel = string },
    [2] = { ... },  -- optional front plate
}
```

Black flipper:

```lua
{
    flip   = true,
    black  = true,
    base64 = string,
    active = boolean,
}
```

Custom flipper:

```lua
{
    flip   = true,
    active = boolean,
    plates = {
        [1] = { base64 = string, offset = { x, y, z }, rotation = { x, y, z }, plateModel = string },
        [2] = { ... },  -- optional front plate
    },
}
```

**Example**

```lua
local data = exports.rm_customplate:getPlateData('ABC1234')
if data then
    if data.flip then
        print(('flipper active=%s'):format(tostring(data.active)))
    else
        print(('normal plate, %d entry(ies)'):format(#data))
    end
end
```


---

# 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/custom-plates-with-flipper/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.
