> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/custom-plates-with-flipper/exports.md).

# 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
```
