> For the complete documentation index, see [llms.txt](https://code-after-sex.gitbook.io/script-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code-after-sex.gitbook.io/script-documentation/cas-advanced-inventory/configuration.md).

# Configuration

Every option of CAS Advanced Inventory for RedM. Look, keys, slots, pocket, ground drops, give, trade, search, weapons, sounds, webhooks, anti abuse limits, starter items and respawn rules.

All settings live in `config/`. These files stay open in the Escrow build too. Restart the server after a change.

## I want to...

| I want to                                            | File                                             | Option                                                                                                                                                       |
| ---------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Change the default look, or lock it                  | `config/config.lua`                              | `Config.Style`, `Config.AllowStyleChange`                                                                                                                    |
| Change the language                                  | `config/config.lua`                              | `Config.Locale` ([Languages](/script-documentation/cas-advanced-inventory/languages.md))                                                                     |
| Change a text                                        | `locales/<language>.lua`                         | the key of that text                                                                                                                                         |
| Change the open key or other keys                    | `config/config.lua`                              | `Config.Keys`                                                                                                                                                |
| Give the satchel more or fewer slots                 | `config/config.lua`                              | `Config.Slots` (VORP). On RSG the player's own `slots` are used                                                                                              |
| Change how much a player can carry                   | your framework                                   | VORP: the character's capacity (`characters.slots`, in kg). RSG: the player's `weight`. `Config.DefaultMaxWeight` is used only when the framework gives none |
| Turn off the pocket                                  | `config/config.lua`                              | `Config.PocketSlots = 0`                                                                                                                                     |
| Drop at the feet instead of placing by hand          | `config/config.lua`                              | `Config.Drops.Place = false`                                                                                                                                 |
| Rename or turn off `/trade`, `/search`, `/craft`     | `config/config.lua`                              | `Config.Commands`                                                                                                                                            |
| Choose who can confiscate                            | `config/config.lua`                              | `Config.Search.ConfiscateJobs`                                                                                                                               |
| Change how many guns a player may carry              | `config/config_server.lua`                       | `ServerConfig.MaxWeapons`, `MaxWeaponsJobs`, `WeaponNoCount`                                                                                                 |
| Add, rename or remove weapon parts                   | `config/parts.lua`                               | `Weapons` ([Weapons](/script-documentation/cas-advanced-inventory/weapons.md))                                                                               |
| Change the cleaning item                             | `config/config.lua`                              | `Config.Weapons.CleanItem`                                                                                                                                   |
| Add crafting recipes, combinations, bags             | `config/crafting.lua`                            | ([Crafting and containers](/script-documentation/cas-advanced-inventory/crafting.md))                                                                        |
| Items carried in the arms                            | `config/config.lua`                              | `Config.Carry.Items`                                                                                                                                         |
| Clothing pieces or the character script              | `config/clothing.lua`                            | ([Outfit](/script-documentation/cas-advanced-inventory/outfit.md))                                                                                           |
| Discord logs                                         | `config/config_server.lua`                       | `ServerConfig.Webhooks`                                                                                                                                      |
| Starter items for new characters                     | `config/config_server.lua`                       | `ServerConfig.StartItems`, `StartWeapons`                                                                                                                    |
| Losing items on respawn                              | `config/config_server.lua`                       | `ServerConfig.Respawn`                                                                                                                                       |
| Admin permission                                     | `config/config_server.lua` / `server.cfg`        | `ServerConfig.AdminAce`, `AdminGroups`                                                                                                                       |
| Hunger and thirst from another metabolism            | `config/config.lua` / `config/config_server.lua` | `Config.Metabolism`, `ServerConfig.Metabolism`                                                                                                               |
| Portraits from your own service, or no Steam avatars | `config/config.lua`                              | `Config.PortraitUrl`, `Config.SteamAvatars`                                                                                                                  |
| Item pictures                                        | `html/img/items/` (VORP), `html/images/` (RSG)   | `<item name>.png`                                                                                                                                            |
| Car trunk size                                       | `config/config.lua`                              | `Config.Trunks`                                                                                                                                              |

| File                                    | What it holds                                                                                                                                |
| --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `config/config.lua`                     | Look, language, keys, slots, pocket, drops, give, trade, search, outfit, carry, weapons, sounds, pictures                                    |
| `config/config_server.lua`              | Discord webhooks, anti abuse limits, starter items, respawn rules, admin permission, RSG options                                             |
| `config/crafting.lua`                   | Hand crafting recipes, combinations, pouches and boxes ([Crafting and containers](/script-documentation/cas-advanced-inventory/crafting.md)) |
| `config/clothing.lua`                   | Outfit provider, the 16 pieces and their commands ([Outfit](/script-documentation/cas-advanced-inventory/outfit.md))                         |
| `config/weapons.lua`, `config/ammo.lua` | Weapon names, weights, groups, clip sizes and gunbelt ammo caps (same shape as VORP's data files)                                            |

## General

| Option                    | Default    | Meaning                                                                                                        |
| ------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------- |
| `Config.Framework`        | `'auto'`   | `'auto'`, `'vorp'` or `'rsg'`                                                                                  |
| `Config.Locale`           | `'en'`     | `en`, `tr`, `de`, `fr`, `es`, `pt-br` ([Languages](/script-documentation/cas-advanced-inventory/languages.md)) |
| `Config.Style`            | `'outlaw'` | Default look: `'outlaw'` (the red poster) or `'minimal'`                                                       |
| `Config.AllowStyleChange` | `true`     | Players may switch the look in the settings (F1)                                                               |
| `Config.CloseKeyLabel`    | `'TAB'`    | The key shown on the close hint                                                                                |
| `Config.WalkWhileOpen`    | `true`     | Players can walk while the satchel is open (they can switch it off in the settings)                            |
| `Config.Details`          | `'hover'`  | Item details follow the mouse (`'hover'`) or show the clicked item (`'docked'`)                                |

## Keys

`Config.Keys` uses RedM control hashes.

| Key                              | Default      | Action                                                 |
| -------------------------------- | ------------ | ------------------------------------------------------ |
| `Open`                           | I            | Opens the satchel. TAB and ESC close it                |
| `HotbarHold`                     | LEFT ALT     | Hold to show the hotbar, then 1 to 5                   |
| `Hotbar`                         | 1 to 5       | The five hotbar slots                                  |
| `PickUp`                         | G            | Opens the satchel with the ground panel next to a drop |
| `PlaceConfirm`                   | ENTER        | Puts a placed drop down                                |
| `PlaceCancel`                    | BACKSPACE    | Cancels placing                                        |
| `PlaceRotLeft` / `PlaceRotRight` | LEFT / RIGHT | Turn a placed drop (the mouse wheel turns it in steps) |
| `CarryDrop`                      | G            | Puts down what you carry in your arms                  |
| `CarryHorse`                     | H            | Loads what you carry onto your horse                   |

`Config.HotbarHoldOnly = true` means the number keys only use the hotbar while ALT is held, so 1 to 5 keep their normal game use.

## Chat commands

```lua
Config.Commands = { Trade = 'trade', Search = 'search', Craft = 'craft' }
Config.HandCrafting = true
```

`/trade` and `/search` pick the closest player, or take a server id (`/trade 12`). `/craft` opens hand crafting. Set a command to `''` to turn it off (for example when another script already uses `/search`). Radial menus can use the client events instead, see [For developers](/script-documentation/cas-advanced-inventory/developers.md#starting-things-from-other-scripts). `Config.HandCrafting = false` hides the crafting button and the command.

## Satchel

| Option                    | Default                                                    | Meaning                                                                                                |
| ------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `Config.Slots`            | `25`                                                       | Slots in the satchel (5 x 5). Inventories with more stacks than slots grow and scroll, nothing is lost |
| `Config.PocketSlots`      | `2`                                                        | Hidden pocket kept on death. `0` turns it off                                                          |
| `Config.PocketMaxWeight`  | `1.0`                                                      | Heaviest single item the pocket takes (kg)                                                             |
| `Config.DefaultMaxWeight` | `35.0`                                                     | Carry weight when the framework gives none                                                             |
| `Config.WeightUnit`       | `'KG'`                                                     | Unit shown next to weights                                                                             |
| `Config.Currency`         | `'$'`                                                      | Money symbol                                                                                           |
| `Config.Categories`       | all, weapons, ammo, food, remedies, tools, valuables, misc | The category tabs, in order                                                                            |

## Ground drops

```lua
Config.Drops = {
  Enabled = true,
  Radius = 2.5,       -- metres to see a drop in the ground panel
  MergeRadius = 1.5,  -- dropping near an existing drop adds to it
  Lifetime = 30,      -- minutes before an untouched drop is cleaned up
  Props = { ... },    -- prop by total weight (sack, cotton box, chest)
  WeaponProps = true, -- a lone dropped weapon shows its own model
  Slots = 30,
  Place = true,       -- the rider places a drop by hand; false drops it at the feet
  PlaceDistance = 2.2, -- metres from the rider a drop can be placed (keep it under Radius)
  PlaceMerge = 0.5,   -- placed right on another drop: they become one
}
```

**Placing by hand.** Dropping from the satchel (drag to the ground box, right click Drop, the money card) steps the satchel aside and shows a see-through copy of what will lie there: a sack, a box, a chest or the weapon itself. It follows where the rider looks, within `PlaceDistance`, and sits on the ground or on a table, a crate or a porch. The game's own prompts show the keys: ENTER puts it down, LEFT / RIGHT (or the mouse wheel) turn it, BACKSPACE cancels. A weapon in hand goes back on the belt first, and the mouse buttons stay off while placing, so a click never fires. The server checks the spot again before anything leaves the satchel, then the satchel opens again. On a horse, in a wagon, or with `Place = false` the drop lands at the feet as before.

## Car trunks (cas-car1910)

```lua
Config.Trunks = {
  Enabled = true,
  Resource = 'cas-car1910',
  Parts = { 'trunk', 'tailgate', 'hamper' }, -- the car parts that hold things
  Slots = 20,
  MaxWeight = 80.0,      -- kg
  Distance = 1.8,        -- metres from the back of the car where the prompt shows
  ServerDistance = 6.0,  -- metres from the car the server still allows
  CloseKey = 0x760A9C6F, -- G held closes the lid from the same prompt group
  CloseHoldMs = 600,
}
```

Open the trunk, tailgate or hamper of a Car1910 or a car pack car with the car's own key (hold G at the back). While it is open, one **Trunk** prompt shows there: **I** looks inside (the satchel opens with the trunk beside it) and **G held** closes the lid. A car with a registration plate keeps its trunk: it is a shared stash per plate, saved like any stash, so it is the same trunk when the garage brings the car out again. A car without a plate gets a trunk that lasts while the car exists. One rider is inside a trunk at a time; closing the lid or walking away closes it. The car script is not changed: the inventory reads the car's part state and uses its `BlockFootPrompts` export and its own toggle.

## Give, trade and search

```lua
Config.Give = { Enabled = true, Distance = 3.0, AcceptSeconds = 15 }
Config.Trade = { Enabled = true, Distance = 4.0 }
Config.Search = {
  Enabled = true,
  Distance = 2.5,
  HandsUpSeconds = 40,   -- how long the victim keeps their hands up
  AllowHandsUp = true, AllowHogtied = true, AllowCuffed = true, AllowDead = true,
  ConfiscateJobs = { sheriff = 0, police = 0, marshal = 0, lawman = 0 }, -- job = minimum grade
  EvidenceStash = 'evidence_locker',
}
```

See [Give, trade and search](/script-documentation/cas-advanced-inventory/give-trade-search.md) for how each one plays.

## Outfit and carrying

* `Config.Outfit = { Enabled = true, TakeOffMs = 1400 }`: the take off and put on time.
* `Config.Carry.Items`: items carried in the arms instead of the satchel (slow walk, no weapons), with the prop, bone and offsets. Panther and bear pelts (`panthers`, `bear_pelt`) are set up as examples.

## Weapons (VORP)

| Option          | Default          | Meaning                                                                                                                                                                                                                                                                 |
| --------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `MaxLong`       | `2`              | Long arms equipped at once                                                                                                                                                                                                                                              |
| `MaxShort`      | `2`              | Sidearms equipped at once                                                                                                                                                                                                                                               |
| `DualWield`     | `true`           | Two sidearms at once                                                                                                                                                                                                                                                    |
| `CleanItem`     | `'gun_oil'`      | Item used to clean a weapon from the inspect screen                                                                                                                                                                                                                     |
| `CleanRestores` | `0.25`           | Condition one oil gives back                                                                                                                                                                                                                                            |
| `SyncSeconds`   | `5`              | How often ammo and wear are reported while a weapon is out                                                                                                                                                                                                              |
| `Gunsmith`      | `'cas-gunsmith'` | Folder name of CAS Gunsmith. While it runs, drawing a weapon never asks vorp\_weaponsv2 to put its own copy of the parts back on. Without it, only guns whose parts all come from vorp\_weaponsv2's own bench are handed to it; the satchel fits every other gun itself |

On RSG Core weapons stay with `rsg-weapons`. The weapon screen, parts, cleaning and carry limits are explained on [Weapons](/script-documentation/cas-advanced-inventory/weapons.md).

| Option (`config/config_server.lua`) | Default                                        | Meaning                                        |
| ----------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
| `ServerConfig.MaxWeapons`           | `10`                                           | Weapons a character may carry. `-1` = no limit |
| `ServerConfig.MaxWeaponsJobs`       | `{ sheriff = 15, police = 15 }`                | Jobs with their own limit                      |
| `ServerConfig.WeaponNoCount`        | binoculars, lanterns, knife, lasso, camera ... | Tools that never count toward the limit        |

## Weapon parts (`config/parts.lua`)

Scopes, sights, barrels, grips, stocks and forends travel as items. Taking a part off a weapon puts it in the satchel; dragging a part item onto the weapon screen fits it, and the part it replaces comes back to the satchel. Each change is one transaction, so a part can never be in two places. Paint, engraving, rifling and wraps stay with a gunsmith.

| Option     | Meaning                                                                                                                                                                                                      |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Enabled`  | `false` turns parts as items off (the weapon screen still shows the gun and its parts)                                                                                                                       |
| `Items`    | The item used for each kind of part (`wpart_scope`, `wpart_sight`, `wpart_barrel`, `wpart_grip`, `wpart_stock`, `wpart_forend`). The part itself is in the item's metadata (`comp`, `label`, `weapon`)       |
| `ItemDefs` | Label, weight and description of those items. VORP: the rows are added to the `items` table on start when missing. RSG: they are added to the shared items                                                   |
| `Weapons`  | Every weapon with its parts: `{ comp, name, stock, desc, stats }`. `stock = true` is the factory part: free and never an item. `stats` (accuracy, range, fireRate, reload, damage) show on the weapon screen |

The weapon screen shows the gun's own game model in 3D (drag to turn it, wheel to zoom, double click to reset). The models are in `html/assets/w3d` (about 19 MB, downloaded once by each player).

## Sounds, meters and pictures

* `Config.Sounds`: the frontend sound for open, close, hover, pick, drop, error and use.
* `Config.PortraitUrl` and `Config.SteamAvatars`: the portrait on the WANTED poster, the give list, gift cards, trades and searches. A `PortraitUrl` with `{id}` wins; otherwise each rider's Steam avatar (through the server's `steam_webApiKey` when set, else the public Steam profile). Riders without Steam show the engraving.
* `Config.Metabolism`: returns hunger and thirst from 0 to 1 for the meters on the Outlaw poster. Out of the box it reads CAS Metabolism, BLN HUD, Outsider Needs and VORP Metabolism on the client, then the common hunger / thirst state bags. Return `nil, nil` to hide the meters, or read your own metabolism script here.
* `ServerConfig.Metabolism` (config\_server.lua): the same for a metabolism that keeps its values on the server. Out of the box: bcc-corehud and RSG Core's player metadata. The client reader wins when it finds values.
* `Config.Images`: picture paths tried in order, `{name}` is the item name.

## Server options (`config/config_server.lua`)

| Option                                     | Default                 | Meaning                                                                                                                                                                                |
| ------------------------------------------ | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ServerConfig.Webhooks`                    | all `''`                | Discord webhooks per channel: `give`, `drop`, `trade`, `search`, `stash`, `admin`, `suspicious`                                                                                        |
| `ServerConfig.WebhookName`                 | `'CAS Inventory'`       | Name of the webhook sender                                                                                                                                                             |
| `ServerConfig.MaxActionsPerSecond`         | `12`                    | Satchel actions per player per second; more are refused and logged                                                                                                                     |
| `ServerConfig.MaxTransfer`                 | `100000`                | Largest single move, give or drop amount                                                                                                                                               |
| `ServerConfig.UseCooldownMs`               | `600`                   | Cooldown between item uses                                                                                                                                                             |
| `ServerConfig.StartItems` / `StartWeapons` | empty                   | Given to new VORP characters. On RSG the character creator hands out starter items                                                                                                     |
| `ServerConfig.Respawn`                     | off                     | What a player loses on respawn after death: items, weapons, ammo, a money and gold percentage, with jobs that keep everything and items that are never lost. The pocket is always kept |
| `ServerConfig.AdminAce`                    | `'cas_inventory.admin'` | Ace for `/invadmin`                                                                                                                                                                    |
| `ServerConfig.AdminGroups`                 | admin, superadmin, god  | Framework groups allowed to use `/invadmin`                                                                                                                                            |
| `ServerConfig.RsgAutoItemBox`              | `false`                 | RSG: show the item box popup from the AddItem / RemoveItem exports                                                                                                                     |
| `ServerConfig.RsgForceDrop`                | `true`                  | RSG: a full bag drops the rest on the ground instead of failing (like rsg-inventory)                                                                                                   |
| `ServerConfig.RsgClientStashOpen`          | `false`                 | RSG: allow clients to open unrestricted stashes by name                                                                                                                                |
