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

# Installation

How to install CAS Advanced Inventory on a VORP or RSG Core RedM server as a drop-in replacement for vorp\_inventory or rsg-inventory, keeping every player's items.

CAS Advanced Inventory takes the place of your current inventory. Other scripts find it under the stock name, so the folder name matters.

{% hint style="warning" %}
Make a database backup before you swap inventories. Nothing is converted, but a backup is always the safe first step.
{% endhint %}

## VORP

1. Stop the server and move your current `vorp_inventory` folder out of `resources` (keep it as a backup).
2. Put CAS Advanced Inventory in its place and **name the folder `vorp_inventory`**. Other scripts look for that exact name.
3. Copy the item pictures from your old inventory: `vorp_inventory/html/img/items/*.png` into the new folder's `html/img/items/`. Stores, crafting menus and other scripts load the pictures from there.
4. Keep the start order in `server.cfg`:

```
ensure oxmysql
ensure vorp_core
ensure vorp_inventory
# everything else after
```

5. Start the server. Players keep everything they own: items, weapons, gunbelts and stashes are read from the same tables (`items`, `items_crafted`, `character_inventories`, `loadout`, `characters.ammo`).

## RSG Core

1. Stop the server and move your current `rsg-inventory` folder out of `resources`.
2. Put CAS Advanced Inventory in its place and **name the folder `rsg-inventory`**. rsg-core and many scripts call it by that name.
3. Copy the pictures: `rsg-inventory/html/images/*.png` into the new folder's `html/images/`.
4. Start order:

```
ensure oxmysql
ensure ox_lib
ensure rsg-core
ensure rsg-inventory
# everything else after
```

5. Player items stay in `players.inventory`, stashes in `inventories` and weapon serials in `player_weapons`. Nothing is migrated.

## The framework is picked for you

`Config.Framework = 'auto'` in `config/config.lua` uses VORP when `vorp_core` runs and RSG when `rsg-core` runs. Set `'vorp'` or `'rsg'` only if you run something unusual.

## Database

On the first start the inventory creates three small tables of its own: slot positions, player settings (look, hotbar, panel options) and weapon history. If your database user may not create tables, run `sql/install.sql` once by hand.

## Item pictures

Pictures are looked up by item name: `html/img/items/<name>.png` (VORP) or `html/images/<name>.png` (RSG). An item can also point to its own picture with the `image` metadata key. When no picture exists the slot shows the category icon instead of a broken image. You can change the search paths with `Config.Images`.

## After the first start

* Press **I** in game to open the satchel, **F1** inside it for the look and the settings.
* Read [Configuration](/script-documentation/cas-advanced-inventory/configuration.md) for keys, slots, drops, give, trade, search and weapons.
* Choose the language with `Config.Locale` ([Languages](/script-documentation/cas-advanced-inventory/languages.md)).

## Good to know on the first day

* **vorp\_weaponsv2:** turn off its customization benches (`customizationLocations = {}` in its config). Parts are fitted from the weapon screen now ([Weapons](/script-documentation/cas-advanced-inventory/weapons.md#vorp_weaponsv2)).
* **Searching** needs your hands-up script, see [Stashes and other scripts](/script-documentation/cas-advanced-inventory/compatibility.md#searching-needs-hands-up).
* **Steam portraits:** with `set steam_webApiKey "..."` in `server.cfg` the avatars come from the Steam Web API; without it from the public Steam profile.
* **3D weapon models** (`html/assets/w3d`, about 28 MB) download once with the resource.

{% hint style="info" %}
Restart the whole server after you swap or update the inventory. Do not restart only the inventory while players are online: scripts register their usable items and their stashes with it when they start.
{% endhint %}
