> For the complete documentation index, see [llms.txt](https://docs.fivemcustoms.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fivemcustoms.com/fc-lspdbadge/configuration.md).

# Configuration

Everything you can change in config.lua.

Every option lives in `config.lua` and each line has a comment. These are the ones you'll most likely want to touch.

## General

| Option             | Default          | What it does                                                        |
| ------------------ | ---------------- | ------------------------------------------------------------------- |
| `Config.Locale`    | `'en'`           | Language of the script, see [Languages](/fc-lspdbadge/languages.md) |
| `Config.Framework` | `'auto'`         | `'auto'`, `'esx'`, `'qb'` or `'qbx'`                                |
| `Config.Item`      | `'lspd_badge'`   | Item name, the same one you used in ox\_inventory                   |
| `Config.Jobs`      | `{ police = 0 }` | Jobs that can register a badge and the lowest grade allowed         |
| `Config.Debug`     | `false`          | Prints extra info in the server console                             |

## Badge offices

{% code title="config.lua" %}

```lua
Config.Locations = {
    {
        ped = {
            model = 's_f_y_cop_01',
            coords = vec4(459.3778, -957.4548, 30.2503, 209.0965),
            scenario = 'WORLD_HUMAN_CLIPBOARD',
        },
        target = {
            icon = 'fa-solid fa-id-badge',
            distance = 2.0,
        },
        blip = {
            enabled = true,
            sprite = 526,
            color = 29,
            scale = 0.7,
        },
        photoSpot = nil, -- vec4(460.12, -990.85, 30.69, 90.0)
    },
}
```

{% endcode %}

* `ped.coords` is a vec4, the last value is the heading.
* `ped.scenario` is what the ped is doing. Remove it for a ped that just stands there.
* `photoSpot` is optional. The player is moved here for the photo and brought back afterwards, handy if you have a plain wall in your MLO. Leave it `nil` to take the photo where the player is standing.
* You can add `label` to the location, `target.label` and `blip.label`. If you leave them out the text comes from the language file.

To add another office, copy the whole block and change the coords.

## Badge number

{% code title="config.lua" %}

```lua
Config.BadgeNumber = {
    mode = 'manual',
    minLength = 3,
    maxLength = 5,
    autoLength = 5,
}

Config.SerialLength = 6
```

{% endcode %}

| Option                    | What it does                                                               |
| ------------------------- | -------------------------------------------------------------------------- |
| `mode`                    | `'manual'` the officer types the number, `'auto'` the script generates one |
| `minLength` / `maxLength` | Allowed length in manual mode                                              |
| `autoLength`              | Length of the generated number in auto mode                                |
| `Config.SerialLength`     | Length of the serial number printed on the card, always random             |

Badge numbers are digits only and can't be used twice.

## Ranks

{% code title="config.lua" %}

```lua
Config.Ranks = {
    [0] = { label = 'Police Officer I',   title = 'POLICE OFFICER', metal = 'silver' },
    [1] = { label = 'Police Officer II',  title = 'POLICE OFFICER', metal = 'silver' },
    [2] = { label = 'Sergeant I',         title = 'SERGEANT',       metal = 'gold' },
    [3] = { label = 'Lieutenant I',       title = 'LIEUTENANT',     metal = 'gold' },
    [4] = { label = 'Chief of Police',    title = 'CHIEF OF POLICE', metal = 'gold' },
}
```

{% endcode %}

The number in brackets is the job grade. `label` is printed on the id card, `title` goes on the ribbon at the top of the badge and `metal` picks a `'silver'` or `'gold'` badge. A grade that isn't in the list uses the grade name from your framework with a silver badge.

## Replacement

{% code title="config.lua" %}

```lua
Config.Duplicate = {
    price = 500,
    account = 'cash',
    onlyIfMissing = true,
}

Config.InvalidateOldCards = true
```

{% endcode %}

| Option                      | What it does                                                                             |
| --------------------------- | ---------------------------------------------------------------------------------------- |
| `price`                     | Cost of a replacement, `0` makes it free                                                 |
| `account`                   | `'cash'` or `'bank'`                                                                     |
| `onlyIfMissing`             | The officer can't ask for a new one while carrying a valid badge                         |
| `Config.InvalidateOldCards` | When a new card is printed, older copies show a VOID stamp. With `false` they stay valid |

## Card text

{% code title="config.lua" %}

```lua
Config.Card = {
    department = 'LOS SANTOS POLICE DEPARTMENT',
    city = 'CITY OF LOS SANTOS',
    state = 'STATE OF SAN ANDREAS',
    chief = 'D. Whitmore',
    validityYears = 4,
    returnText = 'This card is the property of the City of Los Santos. If found, return to any LSPD station.',
}
```

{% endcode %}

This is what gets printed on the id card. It's in English on purpose so the card looks like a real US document, whatever language your server uses.

## Other options

| Option                    | Default         | What it does                                                                                    |
| ------------------------- | --------------- | ----------------------------------------------------------------------------------------------- |
| `Config.AllowPhotoUpdate` | `true`          | Officers can retake their photo at the ped                                                      |
| `Config.ShowDistance`     | `3.0`           | Max distance to show the badge to someone                                                       |
| `Config.DisplayTime`      | `12000`         | How long (ms) the other player sees your badge, `0` means until they close it                   |
| `Config.SpawnDistance`    | `50.0`          | The ped only exists when a player is this close                                                 |
| `Config.Photo`            |                 | Camera and photo settings. The defaults work well, touch them only if the photo is framed badly |
| `Config.Animation`        |                 | Animation and prop played when looking at or showing the badge                                  |
| `Config.Commands`         |                 | Command names, see [Commands & exports](/fc-lspdbadge/commands-and-exports.md)                  |
| `Config.AdminGroup`       | `'group.admin'` | Ace group allowed to use the admin commands                                                     |


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.fivemcustoms.com/fc-lspdbadge/configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
