> For the complete documentation index, see [llms.txt](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/commands-and-permissions.md).

# Commands & permissions

## Commands

| Command                            | Who                                   | What it does                                                                                                   |
| ---------------------------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `/weaponeditor`                    | Players with at least the `use` level | Opens the editor. The name comes from `Config.Command`.                                                        |
| `/weaponeditor_close`              | Everyone                              | Emergency exit if the mouse stays locked (closes the UI and releases focus). Always `/<Config.Command>_close`. |
| `/gwe_rescan`                      | `admin` or server console             | Rescans the weapon resources running on the server and reports the number of weapons found.                    |
| `/wepeditor_selftest [id] [check]` | `admin` or server console             | Prints a diagnostic report in the server console (see below).                                                  |

## Keybind

`Config.Keybind` (default `false`) registers an optional key for the editor, e.g. `Config.Keybind = 'F10'`. It is registered with FiveM key mapping as **Weapon Editor**, so each player can rebind it in **Settings > Key Bindings > FiveM**.

## Permission levels

Levels are **cumulative**: `admin` > `hot` > `edit` > `use`. Permissions are re-checked by the server on **every** request.

| Level   | ACE                           | Grants                                                  |
| ------- | ----------------------------- | ------------------------------------------------------- |
| `use`   | `ghiaccio_weaponeditor.use`   | Read-only access and local preview.                     |
| `edit`  | `ghiaccio_weaponeditor.edit`  | LIVE fields.                                            |
| `hot`   | `ghiaccio_weaponeditor.hot`   | HOT/RESTART fields, ammo, attachments.                  |
| `admin` | `ghiaccio_weaponeditor.admin` | Everything: global presets, rollback, rescan, selftest. |

### ACE (always active)

```cfg
add_ace group.admin ghiaccio_weaponeditor.admin allow
add_ace group.admin ghiaccio_weaponeditor.hot allow
add_ace group.mod   ghiaccio_weaponeditor.edit allow
add_ace group.mod   ghiaccio_weaponeditor.use allow

# a single player
add_ace identifier.license:YOUR_LICENSE ghiaccio_weaponeditor.admin allow
```

The `ghiaccio_weaponeditor` prefix can be changed with `Config.Permissions.acePrefix`.

### Framework groups (optional)

Map a framework group to a level in `config.lua`:

```lua
Config.Permissions.groups = {
    admin = 'admin',
    god = 'admin',
}
```

ESX reads `xPlayer.getGroup()`, QBCore uses `HasPermission`, Qbox and standalone check the ACE group `group.<name>`.

### Jobs (optional)

Give a job with a minimum grade access to LIVE fields:

```lua
Config.Permissions.jobs = {
    armaiolo = { minGrade = 3, level = 'edit' },
}
```

{% hint style="info" %}
Jobs can grant at most `edit` (LIVE fields only), never `hot` or `admin`.
{% endhint %}

### Licenses (deprecated)

`Config.AllowedLicenses` (from v1) still gives admin access but is deprecated and prints a warning. Use `add_ace identifier.license:... ghiaccio_weaponeditor.admin allow` instead.

## /wepeditor\_selftest

Admin command (ACE `ghiaccio_weaponeditor.admin`). From the server console pass the id of a connected player: `wepeditor_selftest <id>`. It prints a PASS/FAIL/INFO report in the **server console**:

| Test                  | Checks                                                                                                                                                                                                                                                                                     |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **S1/S2** (LIVE)      | Damage modifier and getter, spread, recoil, explosion radius, global natives, state bag read. S2 is INFO: `GetWeaponDamage` **includes** the modifier, so the client reads base damage with the modifier at 1.0 and caches it; S2b checks the cache equals the value read at modifier 1.0. |
| **S5** (INFO)         | `data_file_extra` format and `io.popen` file listing (if unavailable, use `Config.ExtraMetaFiles`).                                                                                                                                                                                        |
| **S6**                | `SaveResourceFile` into the patch (prints the `add_filesystem_permission` line if denied).                                                                                                                                                                                                 |
| **S3** (INFO)         | Hot reload does not work on build 3258; the selftest no longer tries it.                                                                                                                                                                                                                   |
| **S7** (instructions) | Set Pistol `ClipSize` to 50 in the editor, save, **reconnect**, then run `/wepeditor_selftest check` (console: `wepeditor_selftest <id> check`). `check` compares the client's `GetWeaponClipSize` / `GetMaxAmmoInClip` for the Pistol with the saved override.                            |

The selftest does not change `Config.HotReload`.


---

# 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://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/commands-and-permissions.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.
