> 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/commands-and-exports.md).

# Comandi ed export

Comandi admin ed export per l'MDT o altri script.

## Comandi admin

Li possono usare solo i giocatori nel gruppo ACE impostato in `Config.AdminGroup` (default `group.admin`). Funzionano anche dalla console del server.

| Comando                 | A cosa serve                                                                                            |
| ----------------------- | ------------------------------------------------------------------------------------------------------- |
| `/badgerevoke [numero]` | Revoca la matricola, i tesserini mostrano REVOKED. Rilancialo per ripristinarla                         |
| `/badgedelete [numero]` | Elimina la matricola, così l'agente può registrarsi di nuovo. I vecchi tesserini smettono di funzionare |

Puoi rinominare entrambi i comandi:

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

```lua
Config.Commands = {
    revoke = 'badgerevoke',
    delete = 'badgedelete',
}

Config.AdminGroup = 'group.admin'
```

{% endcode %}

## Export

Solo lato server. Utile per un MDT, un boss menu o qualsiasi cosa debba conoscere la matricola di un agente.

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

```lua
local badge = exports['FC-LspdBadge']:GetBadge(source)

if badge then
    print(badge.badge_number, badge.rank_label, badge.division)
end
```

{% endcode %}

Al posto di `source` puoi passare l'identificativo del personaggio: `identifier` su ESX oppure `citizenid` su QBCore e Qbox. Restituisce `nil` se l'agente non è registrato.

| Campo                       | Contenuto                                       |
| --------------------------- | ----------------------------------------------- |
| `badge_number`              | Numero di matricola                             |
| `serial`                    | Numero seriale del tesserino                    |
| `firstname` / `lastname`    | Nome stampato sul tesserino                     |
| `dob` / `sex`               | Data di nascita e sesso                         |
| `grade` / `rank_label`      | Grado del lavoro e grado stampato sul tesserino |
| `division`                  | Divisione scelta alla registrazione             |
| `issue`                     | Quante volte è stato stampato il tesserino      |
| `revoked`                   | `1` se revocata, altrimenti `0`                 |
| `identifier`                | Identificativo del personaggio                  |
| `created_at` / `updated_at` | Timestamp Unix                                  |

La foto non è inclusa, per tenere il risultato leggero.


---

# 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/commands-and-exports.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.
