> For the complete documentation index, see [llms.txt](https://docs.hyper-code.eu/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyper-code.eu/documentation/inventory/config.md).

# Inventory – Configuration

All options in the Inventory config files: notifications, keys, money accounts, trading, drops, weapons, vehicle storage, Discord logs and translations.

The main settings are in four files in `shared/`. The plugins have their own config files, see [Plugins](https://docs.hyper-code.eu/documentation/inventory/plugins.md). None of these files are escrowed.

| File                        | Content                                                                   |
| --------------------------- | ------------------------------------------------------------------------- |
| `shared/config.lua`         | Notifications, key, money accounts, trading, drops, translations, colours |
| `shared/config_weapon.lua`  | Ammo, attachments, ammo items                                             |
| `shared/config_vehicle.lua` | Trunk and glovebox                                                        |
| `shared/config_discord.lua` | Discord logs                                                              |

## Notifications and progress bar

```lua
Config.ShowNotification = function(source, message, title, type)
    if IsDuplicityVersion() then -- server side
        TriggerClientEvent("hc_notify:notify", source, message, title, type, 3000)
    else -- client side
        exports["hc_notify"]:notify(message, title, type, 3000)
    end
end

Config.CallProgressBar = function(message, duration) -- client side
    exports["hc_notify"]:progressbar(message, duration)
end

Config.CallProgressBarCancel = function() -- client side
    exports["hc_notify"]:cancelProgressbar()
end

Config.ShowHelpNotification = function(message)
    exports['hc_notify']:helpNotify(message, 'E', -1)
end
```

Replace the calls with your own notification and progress bar resource if you do not use [Premium Notify](https://shop.hyper-code.eu/package/6496308). The progress bar is shown while a trade is finalised and while crafting.

## General (config.lua)

| Option                                  | Default                    | Description                                                                                      |
| --------------------------------------- | -------------------------- | ------------------------------------------------------------------------------------------------ |
| `Config.General.OpenKey`                | `"F2"`                     | Default key to open the inventory. Players can change it in **Settings → Key Bindings → FiveM**. |
| `Config.Debug`                          | `false`                    | Print debug messages in the server console                                                       |
| `Config.Inventory.IncludeMoneyAccounts` | `{"money", "black_money"}` | ESX accounts shown as items in the inventory. They can be dropped, given and traded like items.  |

## Trading

| Option                             | Default | Description                                                            |
| ---------------------------------- | ------- | ---------------------------------------------------------------------- |
| `Config.Trade.MaxRange`            | `5.0`   | Maximum distance to a player you want to trade with or give an item to |
| `Config.Trade.TimeToAcceptRequest` | `10`    | Seconds the other player has to accept a trade request                 |
| `Config.Trade.CompletionTime`      | `3`     | Seconds both players must stay ready before the trade completes        |

If a player disconnects during a trade, the items they put into the trade are given back on their next spawn.

## Item drops

| Option                                  | Default                 | Description                                                |
| --------------------------------------- | ----------------------- | ---------------------------------------------------------- |
| `Config.Drop.OpenSecondInventoryOnDrop` | `true`                  | Show the drop next to the inventory after dropping an item |
| `Config.Drop.RemoveDropTime`            | `600`                   | Seconds until a drop is removed (600 = 10 minutes)         |
| `Config.Drop.Radius`                    | `5.0`                   | Items dropped within this radius go into the same drop     |
| `Config.Drop.ItemModel`                 | `'xm_prop_x17_bag_01d'` | Prop shown on the ground at a drop                         |

## Close inventory on use

```lua
Config.CloseInventoryOnUse = {
    "case",
    "case2",
    "clothingbag",
    "shell",
    "notebook"
}

--Config.CloseInventoryOnUse = "always"
```

The inventory closes when one of these items is used, for example items that open their own menu. Set it to `"always"` to close the inventory after every usable item.

## Colours

```lua
Config.Style = {
    LightColor = "rgb(255, 0, 64)",
    DarkColor  = "rgb(138, 0, 34)"
}
```

The two accent colours of the UI. No HTML or CSS knowledge needed.

## Translations

`Config.Translation` in `shared/config.lua` contains the texts of the UI and the notifications. The plugin configs add their own keys to it (for example `CraftingHelpNotify`, `ShopHelpNotify`, `JobStorageTitle`). Keys with `%s` get values filled in, keep the placeholders.

## Item images and descriptions

* **Images**: put a `<itemname>.png` into `html/dist/items`. Items without an image show `notfound.png`. Weapons use the weapon name, for example `WEAPON_PISTOL.png`.
* **Category and description**: set the `category` and `description` columns of the item in the `items` table. They are read when the resource starts.

## Weapons (config\_weapon.lua)

| Option                           | Default | Description                                                                                                  |
| -------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `Config.Weapon.NoMaxAmmo`        | `true`  | Removes the 250 ammo limit per weapon                                                                        |
| `Config.Weapon.AllowWeaponSplit` | `false` | `false` = a weapon is always moved, dropped or given with all its ammo. `true` = players can split the ammo. |

When a weapon is moved, dropped or stored, its attachments move with it.

### Ammo items

```lua
Config.Weapon.Clips = {
    ['weaclip'] = 30,
    ['weabox'] = 150,
}
```

Item name and how much ammo it adds to the weapon in the player's hands. `Config.Weapon.Weapons` lists for each ammo item which weapons it works with:

```lua
Config.Weapon.Weapons = {
    ['weaclip'] = { 'WEAPON_PISTOL', 'WEAPON_SMG', ... },
    ['weabox']  = { 'WEAPON_PISTOL', 'WEAPON_SMG', ... },
}
```

The default lists contain pistols, SMGs, shotguns, rifles, MGs, snipers and the flare gun.

### Attachments

```lua
Config.Weapon.Components = {
    "clip_extended", "clip_drum", "scope", "flashlight", "suppressor", "grip"
}
```

Each entry is a usable item that attaches the ESX weapon component of the same name to the weapon in the player's hands, if the weapon supports it. You need an item for each component (see `items.sql`). Attachments can be removed again in the inventory with **REMOVE COMP.**

### Tints

The items `tint_black`, `tint_green`, `tint_gold`, `tint_pink`, `tint_army`, `tint_lspd`, `tint_orange` and `tint_plat` apply the matching tint to the weapon in the player's hands. This list is fixed.

## Vehicle storage (config\_vehicle.lua)

| Option                           | Default | Description                                                   |
| -------------------------------- | ------- | ------------------------------------------------------------- |
| `Config.Vehicle.OpenKey`         | `"F2"`  | Default key to open trunk or glovebox                         |
| `Config.Vehicle.SingleUseTrunks` | `true`  | Only one player at a time can open the same trunk or glovebox |

* **Trunk**: stand within 2.5 m of an unlocked vehicle.
* **Glovebox**: sit in the driver or front passenger seat.

With the same key for inventory and trunk (default), pressing **F2** next to a vehicle opens both.

{% hint style="info" %}
Trunks and gloveboxes are saved only for vehicles whose plate is in `owned_vehicles`. Items in other vehicles are lost when the vehicle despawns.
{% endhint %}

### Trunk weight

```lua
Config.Vehicle.Trunk = {
    DefaultWeight = 100,
    WeightPerVehicleClass = {
        [0] = 300, --Compact
        [1] = 400, --Sedan
        -- ...
    },
    WeightPerVehicleModel = {
        ["infernus"] = 500
    }
}
```

The weight is in the same unit as your ESX item weights (kg in the default config). A model entry wins over the class entry, the class entry wins over `DefaultWeight`.

| Class             | Weight | Class          | Weight |
| ----------------- | ------ | -------------- | ------ |
| 0 Compact         | 300    | 11 Utility     | 1000   |
| 1 Sedan           | 400    | 12 Vans        | 1500   |
| 2 SUV             | 1000   | 13 Cycles      | 0      |
| 3 Coupes          | 400    | 14 Boats       | 1000   |
| 4 Muscle          | 400    | 15 Helicopters | 0      |
| 5 Sports Classics | 250    | 16 Planes      | 0      |
| 6 Sports          | 400    | 17 Service     | 400    |
| 7 Super           | 50     | 18 Emergency   | 3500   |
| 8 Motorcycles     | 0      | 19 Military    | 0      |
| 9 Off-road        | 1500   | 20 Commercial  | 3500   |
| 10 Industrial     | 8000   | 21 Trains      | 0      |

### Glovebox slots

`Config.Vehicle.Glovebox` works the same way with slots: `DefaultSlots = 2`, `SlotsPerVehicleClass` and `SlotsPerVehicleModel` (default `["infernus"] = 4`). Default slots per class: 2 for most classes, 3 for SUVs, 4 for off-road, industrial, utility and vans, 1 for super cars and 0 for motorcycles, cycles, helicopters, planes and trains.

## Discord logs (config\_discord.lua)

```lua
Config.Discord = {
    Enabled = true,
    Webhooks = {
        Default = "https://discord.com/api/webhooks/your/default/webhook",
        UseItem = "https://discord.com/api/webhooks/",
        GiveItem = "https://discord.com/api/webhooks/",
        DropItem = "https://discord.com/api/webhooks/",
        TradeItem = "https://discord.com/api/webhooks/",
        VehicleStash = "https://discord.com/api/webhooks/",
        JobStorage = "https://discord.com/api/webhooks/",
        ExternalStorage = "https://discord.com/api/webhooks/",
    },
    Colors = { ... },
    AuthorName = "My Server Inventory",
    LogFooter = "HC Inventory • %s"
}
```

| Option             | Description                                                                |
| ------------------ | -------------------------------------------------------------------------- |
| `Enabled`          | Turn all Discord logs on or off. Set it to `false` if you do not use them. |
| `Webhooks.<Type>`  | Webhook per log type                                                       |
| `Webhooks.Default` | Used only for a type whose line is removed or commented out                |
| `Colors`           | Embed colour per event (decimal)                                           |
| `AuthorName`       | Name of the webhook bot                                                    |
| `LogFooter`        | Footer text, `%s` is replaced with the time                                |

{% hint style="info" %}
To send everything to one channel, enter the same URL for every type. Do not change the functions below the line `ONLY CHANGE IF YOU KNOW WHAT YOU ARE DOING`.
{% endhint %}
