> For the complete documentation index, see [llms.txt](https://zloma-scripts.gitbook.io/zloma-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zloma-scripts.gitbook.io/zloma-scripts/zloma_garages-paid/features/fake-plates.md).

# Fake Plates

The fake plates system allows players to temporarily change a vehicle's visible license plate without affecting the database.

***

## How It Works

1. Player needs the `fake_plate` item in their inventory
2. Approach vehicle and use the target option (or item directly)
3. 10-second animation + progress bar (cancellable)
4. Random plate generated and applied visually
5. Original plate stored in vehicle StateBag for recovery
6. Inventory (trunk/glovebox) automatically renamed to new plate
7. Fuel type data synced to new plate

**Removal** reverses the process — inventory and fuel sync back to original plate.

***

## Requirements

* `Config.FakePlates.enabled = true` (default)
* `fake_plate` item registered in your inventory system
* Target system (ox\_target or qb-target) auto-detected via zloma\_core

***

## Adding the Item

Add the `fake_plate` item to your inventory:

**ox\_inventory:**

```lua
-- ox_inventory/data/items.lua
['fake_plate'] = {
    label = 'Fake Plate',
    weight = 500,
    stack = true,
    close = true,
}
```

**QBCore:**

```lua
-- qb-core/shared/items.lua
['fake_plate'] = {
    name = 'fake_plate',
    label = 'Fake Plate',
    weight = 500,
    type = 'item',
    image = 'fake_plate.png',
    unique = false,
    useable = true,
    shouldClose = true,
    description = 'A temporary fake license plate'
},
```

***

## Target Options

When `Config.FakePlates.useTargetSystem = true`, two target options appear:

| Action                        | Position            | Condition                                               |
| ----------------------------- | ------------------- | ------------------------------------------------------- |
| **Apply Fake Plate**          | Anywhere on vehicle | Player has `fake_plate` item, vehicle has no fake plate |
| **Remove Fake Plate (Front)** | Front of vehicle    | Vehicle has fake plate applied                          |
| **Remove Fake Plate (Rear)**  | Rear of vehicle     | Vehicle has fake plate applied                          |

***

## Inventory Sync

When fake plates are applied/removed, trunk and glovebox contents are automatically transferred between the real and fake plate identifiers.

**Supported Inventory Systems:**

* ox\_inventory
* qb-inventory (new and old format)
* ps-inventory
* lj-inventory
* qs-inventory

**Custom sync:** Set `Config.FakePlates.inventorySync.custom = true` and implement `SyncVehicleInventory(oldPlate, newPlate, action)` in `sv_customization.lua`.

{% hint style="info" %}
Inventory sync is crash-safe. Items are never lost — the `zloma_fake_plate_tracking` table tracks active mappings for recovery on restart.
{% endhint %}

***

## Fuel Type Sync (lc\_fuel)

If you use **lc\_fuel**, fuel type data (premium, diesel, etc.) is automatically synced when plates change.

### Required: Add Exports to lc\_fuel

You **must** add two exports to `lc_fuel/server/server.lua`. Find the `setVehicleFuelType` function (around line 560) and add after its closing `end`:

```lua
exports('getVehicleFuelType', getVehicleFuelType)
exports('setVehicleFuelType', setVehicleFuelType)
```

**Why?** lc\_fuel stores fuel types in memory (`playerVehiclesFuelType`). Without exports, zloma\_garages can only write to the database, but lc\_fuel never reads from DB at runtime — so fake plates always show "regular" instead of the correct fuel type.

**Custom sync:** Set `Config.FakePlates.fuelSync.custom = true` and implement `GetVehicleFuelType(plate)` / `SetVehicleFuelType(plate, fuelType)` in `sv_customization.lua`.

***

## Important Behavior

* **Store prevention** — Vehicles with fake plates cannot be stored. Players must remove the fake plate first.
* **Auto-cleanup** — If a vehicle with fake plates is impounded or stored through admin commands, fake plates are automatically cleaned up with proper inventory/fuel sync.
* **Persistent vehicles** — Fake plate info survives entity culling and respawn when persistent vehicles are enabled.
* **Multiplayer sync** — Fake plates are synced to all players via StateBag.
* **Original plate safety** — The original plate is never modified in the database. Only the visual plate text changes.

***

## Config Reference

```lua
Config.FakePlates = {
    enabled = true,
    itemName = 'fake_plate',
    useTargetSystem = true,
    logActions = false,
    inventorySync = {
        enabled = true,
        custom = false,
    },
    fuelSync = {
        enabled = true,
        custom = false,
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://zloma-scripts.gitbook.io/zloma-scripts/zloma_garages-paid/features/fake-plates.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.
