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

# Commands & exports

Admin commands and the export for your MDT or other scripts.

## Admin commands

Only players in the ace group set in `Config.AdminGroup` (default `group.admin`) can use them. They work from the server console too.

| Command                 | What it does                                                                       |
| ----------------------- | ---------------------------------------------------------------------------------- |
| `/badgerevoke [number]` | Revokes the badge, cards show REVOKED. Run it again to restore it                  |
| `/badgedelete [number]` | Deletes the registration so the officer can register again. Old cards stop working |

You can rename both commands:

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

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

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

{% endcode %}

## Export

Server side only. Handy for an MDT, a boss menu or anything that needs to know an officer's badge.

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

Instead of `source` you can pass a character identifier: the `identifier` on ESX or the `citizenid` on QBCore and Qbox. It returns `nil` if the officer isn't registered.

| Field                       | Content                                |
| --------------------------- | -------------------------------------- |
| `badge_number`              | Badge number                           |
| `serial`                    | Serial number of the card              |
| `firstname` / `lastname`    | Name printed on the card               |
| `dob` / `sex`               | Date of birth and sex                  |
| `grade` / `rank_label`      | Job grade and rank printed on the card |
| `division`                  | Division chosen at registration        |
| `issue`                     | How many times the card was printed    |
| `revoked`                   | `1` if revoked, otherwise `0`          |
| `identifier`                | Character identifier                   |
| `created_at` / `updated_at` | Unix timestamps                        |

The photo isn't included, to keep the result light.


---

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