> 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/it/fc-lspdbadge/configuration.md).

# Configurazione

Tutto quello che puoi cambiare in config.lua.

Tutte le opzioni sono in `config.lua` e ogni riga ha il suo commento. Queste sono quelle che toccherai più spesso.

## Generale

| Opzione            | Default          | A cosa serve                                                      |
| ------------------ | ---------------- | ----------------------------------------------------------------- |
| `Config.Locale`    | `'en'`           | Lingua dello script, vedi [Lingue](/it/fc-lspdbadge/languages.md) |
| `Config.Framework` | `'auto'`         | `'auto'`, `'esx'`, `'qb'` o `'qbx'`                               |
| `Config.Item`      | `'lspd_badge'`   | Nome dell'item, lo stesso usato in ox\_inventory                  |
| `Config.Jobs`      | `{ police = 0 }` | Lavori che possono registrare una matricola e grado minimo        |
| `Config.Debug`     | `false`          | Stampa informazioni extra nella console del server                |

## Uffici matricole

{% 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` è un vec4, l'ultimo valore è l'heading.
* `ped.scenario` è cosa sta facendo l'NPC. Toglilo se lo vuoi semplicemente in piedi.
* `photoSpot` è opzionale. Il giocatore viene spostato lì per la foto e poi riportato indietro, comodo se nel tuo MLO hai un muro chiaro. Lascialo `nil` per scattare la foto dove si trova il giocatore.
* Puoi aggiungere `label` alla location, `target.label` e `blip.label`. Se non li metti, il testo viene preso dal file della lingua.

Per aggiungere un altro ufficio copia tutto il blocco e cambia le coordinate.

## Numero di matricola

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

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

Config.SerialLength = 6
```

{% endcode %}

| Opzione                   | A cosa serve                                                        |
| ------------------------- | ------------------------------------------------------------------- |
| `mode`                    | `'manual'` l'agente scrive il numero, `'auto'` lo genera lo script  |
| `minLength` / `maxLength` | Lunghezza consentita in modalità manuale                            |
| `autoLength`              | Lunghezza del numero generato in modalità automatica                |
| `Config.SerialLength`     | Lunghezza del numero seriale stampato sul tesserino, sempre casuale |

Le matricole contengono solo cifre e non possono essere usate due volte.

## Gradi

{% 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 %}

Il numero tra parentesi quadre è il grado del lavoro. `label` viene stampato sul tesserino, `title` va sul nastro in alto del distintivo e `metal` sceglie un distintivo `'silver'` (argento) o `'gold'` (oro). Un grado che non è nella lista usa il nome del grado del framework con distintivo argento.

## Duplicato

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

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

Config.InvalidateOldCards = true
```

{% endcode %}

| Opzione                     | A cosa serve                                                                                                   |
| --------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `price`                     | Costo del duplicato, `0` lo rende gratuito                                                                     |
| `account`                   | `'cash'` o `'bank'`                                                                                            |
| `onlyIfMissing`             | L'agente non può chiedere un duplicato se ha con sé un tesserino valido                                        |
| `Config.InvalidateOldCards` | Quando viene stampato un nuovo tesserino, le copie vecchie mostrano il timbro VOID. Con `false` restano valide |

## Testi del tesserino

{% 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 %}

Questo è quello che viene stampato sul tesserino. È in inglese apposta, così sembra un vero documento americano qualunque sia la lingua del server.

## Altre opzioni

| Opzione                   | Default         | A cosa serve                                                                                                  |
| ------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------- |
| `Config.AllowPhotoUpdate` | `true`          | Gli agenti possono rifare la foto dall'NPC                                                                    |
| `Config.ShowDistance`     | `3.0`           | Distanza massima per mostrare il tesserino                                                                    |
| `Config.DisplayTime`      | `12000`         | Per quanto tempo (ms) l'altro giocatore vede il tesserino, `0` finché non lo chiude                           |
| `Config.SpawnDistance`    | `50.0`          | L'NPC esiste solo quando un giocatore è entro questa distanza                                                 |
| `Config.Photo`            |                 | Impostazioni di fotocamera e foto. I valori di default vanno bene, cambiali solo se la foto è inquadrata male |
| `Config.Animation`        |                 | Animazione e prop quando guardi o mostri il tesserino                                                         |
| `Config.Commands`         |                 | Nomi dei comandi, vedi [Comandi ed export](/it/fc-lspdbadge/commands-and-exports.md)                          |
| `Config.AdminGroup`       | `'group.admin'` | Gruppo ACE che può usare i comandi admin                                                                      |


---

# 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/it/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.
