> For the complete documentation index, see [llms.txt](https://visionstore.gitbook.io/visionstore-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://visionstore.gitbook.io/visionstore-docs/scripts/badges/configuration/issuing.md).

# Issuing and photos

How badges are handed out - distances, self-issue, re-issues, cooldowns, /issuebadge and the photo.

Both blocks are in `config/config.lua`.

## Issuing

```lua
Config.Issuing = {
    NearestDistance = 3.0,      -- metres: the badge goes to the nearest player inside this range
    DeskTolerance = 2.5,        -- metres: how far from the desk centre the issuer may stand (server check)
    AllowSelf = true,           -- adds "issue my own badge" (the issuer must also be a member)
    RequireMembership = true,   -- the recipient must hold one of the badge's jobs / gangs
    UseSecondaryJobs = true,    -- multi-job (qbx): a job the player holds but is not active on counts
    BlockIfCarrying = true,     -- refuse when the recipient already carries a valid badge with the SAME rank
    RevokePrevious = true,      -- a new badge voids that person's older badges of the same type
    ReplaceCarried = true,      -- and takes the older ones out of the recipient's inventory
    Cooldown = 8,               -- seconds between two badges from the same issuer
    ConfirmTimeout = 60,        -- seconds the review panel may stay open
    ShowOnReceive = true,       -- the recipient sees their new badge on screen once
    PrepareDuration = 1500,     -- ms of the "preparing" progress bar (0 = none)
    Anim = { dict = 'anim@heists@prison_heiststation@cop_reactions', clip = 'cop_b_idle', flag = 49 },

    Command = { name = 'issuebadge', anywhere = false },
}
```

| Option              | Default                                     | Meaning                                                                                                                                                                                       |
| ------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NearestDistance`   | `3.0`                                       | Metres. The badge goes to the **nearest** player in range (same routing bucket). While the review panel is open the recipient may move up to 1 m further; after that the badge is not issued. |
| `DeskTolerance`     | `2.5`                                       | Metres beyond the desk radius the issuer may stand. Checked on the server.                                                                                                                    |
| `AllowSelf`         | `true`                                      | Adds **Issue my own `<badge>` badge** at desks and `/issuebadge <badge> self`. The issuer must also hold one of the badge's jobs. `false` blocks self-issue everywhere.                       |
| `RequireMembership` | `true`                                      | The recipient must hold one of the badge's `jobs`. `false`: anybody can receive it, and the rank printed is the grade of their active job.                                                    |
| `UseSecondaryJobs`  | `true`                                      | Multi-job (qbx\_core jobs, ox\_core groups): a job the player holds but is not active on counts for **receiving**. Issuing always uses the active job.                                        |
| `BlockIfCarrying`   | `true`                                      | Refuse when the recipient already carries a valid badge of this type **with the same rank**. After a promotion the rank differs and the re-issue works.                                       |
| `RevokePrevious`    | `true`                                      | A new badge voids that person's older badges of the same type.                                                                                                                                |
| `ReplaceCarried`    | `true`                                      | ...and takes those older badges out of the recipient's inventory.                                                                                                                             |
| `Cooldown`          | `8`                                         | Seconds between two badges from the same issuer.                                                                                                                                              |
| `ConfirmTimeout`    | `60`                                        | Seconds the review panel may stay open before the request expires.                                                                                                                            |
| `ShowOnReceive`     | `true`                                      | The recipient sees their new badge on screen once (not when you issue your own).                                                                                                              |
| `PrepareDuration`   | `1500`                                      | Milliseconds of the "Preparing the badge..." progress bar. It can be cancelled and blocks movement. `0` = no bar.                                                                             |
| `Anim`              | `cop_b_idle`                                | Animation the issuer plays while issuing. `false` = none.                                                                                                                                     |
| `Command`           | `{ name = 'issuebadge', anywhere = false }` | The `/issuebadge` command (below). `Command = false` removes it.                                                                                                                              |

### /issuebadge

```
/issuebadge <badge id> [self]
```

| Example                   | Result                                        |
| ------------------------- | --------------------------------------------- |
| `/issuebadge police`      | Issue a police badge to the nearest player.   |
| `/issuebadge police self` | Issue your own police badge (`me` works too). |
| `/issuebadge`             | Lists the badge ids you can issue.            |

It runs the same flow as a desk (progress bar, photo, review panel) with every check except the desk position.

| `Command.anywhere` | Who may use `/issuebadge`                                                         |
| ------------------ | --------------------------------------------------------------------------------- |
| `false` (default)  | Admins only                                                                       |
| `true`             | Every player who may issue that badge (issuer rule, issuer id or admin), anywhere |

## Photo

The photo is taken **once**, when the badge is issued, and stored with the badge. The issuer can retake it in the review panel.

```lua
Config.Photo = {
    Required = true,            -- false = a badge can still be issued when the capture fails
    Transparent = true,         -- transparent headshot on the card's photo backdrop
    Format = 'image/webp',      -- 'image/webp' | 'image/png' | 'image/jpeg'
    Quality = 0.92,
    CaptureTimeout = 4000,      -- ms
    MaxLength = 150000,         -- characters of the data URI the server accepts
}
```

| Option           | Default        | Meaning                                                                                                                                                |
| ---------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Required`       | `true`         | `false`: a badge can still be issued when the capture fails; the card shows "NO PHOTO".                                                                |
| `Transparent`    | `true`         | Transparent headshot on the card's photo backdrop. Falls back to a normal headshot if the transparent one fails. Use `webp` or `png` for transparency. |
| `Format`         | `'image/webp'` | `'image/webp'`, `'image/png'` or `'image/jpeg'`.                                                                                                       |
| `Quality`        | `0.92`         | 0 to 1, for webp and jpeg.                                                                                                                             |
| `CaptureTimeout` | `4000`         | Milliseconds the interface has to turn the headshot into an image.                                                                                     |
| `MaxLength`      | `150000`       | Largest photo (characters of image data) the server accepts. A larger capture counts as failed.                                                        |

{% hint style="success" %}
**Tip:** keep `Format = 'image/webp'`. It's the smallest format with transparency, so photos load fast and stay under `MaxLength`.
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://visionstore.gitbook.io/visionstore-docs/scripts/badges/configuration/issuing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
