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

# Configuration

The editor has two editable configuration files:

| File                | Sent to clients  | Use it for                                                                   |
| ------------------- | ---------------- | ---------------------------------------------------------------------------- |
| `config.lua`        | **Yes** (shared) | Language, command, permissions, storage, limits. **Never put secrets here.** |
| `config_server.lua` | No (server only) | Secrets, such as the Discord webhook URL.                                    |

{% hint style="warning" %}
`config.lua` is downloaded by every client, so anything written there is readable by any player. Put the webhook in `config_server.lua` or in the `gwe_webhook` convar.
{% endhint %}

## General

| Option             | Default          | Meaning                                                                                                                                                                |
| ------------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Locale`    | `'it'`           | Language: `'it'` or `'en'`.                                                                                                                                            |
| `Config.Framework` | `'auto'`         | `'auto'`, `'esx'`, `'qbcore'`, `'qbox'` or `'standalone'`. See [Installation](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/installation.md). |
| `Config.Command`   | `'weaponeditor'` | Command that opens the editor (`/weaponeditor`). `/<command>_close` is the emergency exit.                                                                             |
| `Config.Keybind`   | `false`          | Optional key, e.g. `'F10'`. `false` = no key.                                                                                                                          |
| `Config.Debug`     | `false`          | Debug mode.                                                                                                                                                            |

## Permissions

ACE permissions are always active (see [Commands & permissions](https://ghiaccioscripts.gitbook.io/ghiaccioscripts-docs/weapons-editor/commands-and-permissions.md)). These options add optional sources:

| Option                         | Default                   | Meaning                                                                                                                                                         |
| ------------------------------ | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Permissions.acePrefix` | `'ghiaccio_weaponeditor'` | Prefix of the ACE permissions (`<prefix>.admin`, `.hot`, `.edit`, `.use`).                                                                                      |
| `Config.Permissions.groups`    | `{}`                      | Framework group to level, e.g. `{ admin = 'admin', god = 'admin' }`. ESX: `xPlayer.getGroup()`; QBCore: `HasPermission`; Qbox/standalone: ACE `group.<name>`.   |
| `Config.Permissions.jobs`      | `{}`                      | Job to `{ minGrade, level }`, e.g. `{ armaiolo = { minGrade = 3, level = 'edit' } }`. Jobs can grant at most `edit` (LIVE fields only), never `hot` or `admin`. |
| `Config.AllowedLicenses`       | `{}`                      | **Deprecated (v1).** Licenses with admin access. Use `add_ace identifier.license:... ghiaccio_weaponeditor.admin allow` instead.                                |

## Reference data

| Option                  | Default                             | Meaning                                                                                                                                                                                                                                                       |
| ----------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Reference`      | `{ owner = false, vanilla = true }` | `vanilla` = bundled GTA V vanilla metas (all hand weapons, DLC included). `owner` = Ghiaccio Weapons meta pack, **not included in the sold version: leave `false`**. Weapon resources running on the server are always scanned and take precedence over both. |
| `Config.ExtraMetaFiles` | `{}`                                | If weapon resources use globs and the server cannot list folders (`io.popen` unavailable), list the files by hand: `{ ['my_weapons'] = { 'metas/weapons.meta', ... } }`.                                                                                      |
| `Config.ExtraWeapons`   | `{}`                                | Extra weapons not present in the data: `{ name = 'WEAPON_XXX', label = 'Name', category = 'pistol' }`. LIVE fields only.                                                                                                                                      |

## Patch and hot reload

| Option                       | Default                         | Meaning                                                                                                                                                                                                                                                                                                  |
| ---------------------------- | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.HotReload`           | `false`                         | **Experimental, does not work on build 3258** (per `/wepeditor_selftest`). Leave `false`: HOT values are written to the patch (or `generated/`) and apply on the next join or restart. `true` = after `HotDebounceMs` the patch resource is restarted and connected clients reload without reconnecting. |
| `Config.HotDebounceMs`       | `3000`                          | Delay (ms) before the patch restart when `HotReload = true`.                                                                                                                                                                                                                                             |
| `Config.PatchResource`       | `'ghiaccio_weaponeditor_patch'` | Name of the patch resource.                                                                                                                                                                                                                                                                              |
| `Config.PatchFile`           | `'weapons_gwe.meta'`            | Weapons patch file.                                                                                                                                                                                                                                                                                      |
| `Config.PatchComponentsFile` | `'weaponcomponents_gwe.meta'`   | Attachments patch file.                                                                                                                                                                                                                                                                                  |

{% hint style="info" %}
In every case `add_filesystem_permission ghiaccio_weaponeditor write ghiaccio_weaponeditor_patch` is required, and `ghiaccio_weaponeditor_patch` must be ensured **after** all other weapon resources. With `HotReload` off the UI hides "Apply and reload" and labels all HOT fields "next join or restart".
{% endhint %}

## Storage

| Option              | Default  | Meaning                                                                             |
| ------------------- | -------- | ----------------------------------------------------------------------------------- |
| `Config.Storage`    | `'json'` | `'json'` (files in `data/`) or `'oxmysql'` (table `gwe_kv`, created automatically). |
| `Config.Backups`    | `20`     | Number of rotating backups of `overrides.json`.                                     |
| `Config.HistoryMax` | `500`    | Snapshots kept in the history.                                                      |

## Limits and rate limit

| Option                              | Default                         | Meaning                                       |
| ----------------------------------- | ------------------------------- | --------------------------------------------- |
| `Config.Limits.maxImportBytes`      | `262144`                        | Maximum import size (256 KB).                 |
| `Config.Limits.maxPresetName`       | `48`                            | Maximum preset name length.                   |
| `Config.Limits.maxBatchWeapons`     | `64`                            | Maximum weapons in one batch.                 |
| `Config.Limits.maxCompare`          | `4`                             | Maximum weapons in the compare view.          |
| `Config.Limits.maxPresets`          | `100`                           | Saved presets in total.                       |
| `Config.Limits.maxPresetsPerAuthor` | `20`                            | Presets per author (admins have no such cap). |
| `Config.RateLimit`                  | `{ burst = 12, perSecond = 4 }` | Per-player token bucket on server requests.   |
| `Config.KillHealth`                 | `120`                           | UI reference for "shots to kill".             |

## Logging

| Option                 | Default                         | Meaning                                                                                                                                                                         |
| ---------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Webhook`       | `''`                            | **Deprecated here.** If set it is still used, but a warning appears at start, because `config.lua` reaches the clients. Use `ServerConfig.Webhook` or the `gwe_webhook` convar. |
| `Config.LogRejections` | `true`                          | Also log rejections (validation, permissions, rate limit) to `data/logs/rejects_YYYY-MM.log`.                                                                                   |
| `Config.VersionCheck`  | `{ enabled = false, url = '' }` | Version check stub: makes no requests until configured.                                                                                                                         |

## config\_server.lua

| Option                 | Default | Meaning                                                                                       |
| ---------------------- | ------- | --------------------------------------------------------------------------------------------- |
| `ServerConfig.Webhook` | `''`    | Discord webhook URL for the audit log (empty = off). Messages are throttled to one every 2 s. |

Alternatively, in `server.cfg` (the convar takes precedence):

```cfg
set gwe_webhook "https://discord.com/api/webhooks/..."
```

## Locales

Texts (field names, tooltips, errors, messages, preset names) are in `locales/en.lua` and `locales/it.lua`, both editable. Every key must exist in both files.


---

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