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

# Installation

Install CAS Owned Shops on your RedM server: VORP Core requirements, the cas\_ownedshops table, server.cfg order and the first checks.

## Requirements

| Resource                       | Needed for                                                      |
| ------------------------------ | --------------------------------------------------------------- |
| `vorp_core` + `vorp_inventory` | Players, money and inventory.                                   |
| `oxmysql`                      | Saving the player-owned shops.                                  |
| `uiprompt`                     | Loaded by the client scripts. It must be installed and started. |

## Steps

1. Put the `cas-ownedshop` folder in your resources folder, for example `resources/[CAS]/cas-ownedshop`.
2. Import `player.sql` into your database. It creates the `cas_ownedshops` table that holds every player-owned shop, its stock, its cash box and its log.
3. Add the resources to `server.cfg`, with the framework and inventory first:

```
ensure oxmysql
ensure vorp_core
ensure vorp_inventory
ensure uiprompt
ensure cas-ownedshop
```

4. Open `config/shared_config.lua` and add your own identifier to `Config.WhoCanCreateStore`, so that you can create and remove shops:

```lua
Config.WhoCanCreateStore = {
    "steam:110000100000000",   -- your Steam hex
}
```

5. Restart the server.

## First checks

* The server console prints `[CAS OWNEDSHOP] Bridge initialized: VORP Core + vorp_inventory`. If it prints `No supported framework detected`, `vorp_core` was not started before `cas-ownedshop`.
* The sample general store from the config has a shopkeeper and a blip. Walk up to it and press **G** to open it.
* Run `/createstore <your server id> MSP_GANG2_MALES_01` somewhere in town. A shopkeeper appears in front of you, and **J** opens the management screen.

{% hint style="info" %}
Item pictures come from the inventory's image folder, `nui://vorp_inventory/html/img/items`, one `<item name>.png` per item. See [Configuration](/script-documentation/cas-owned-shops/configuration.md) to point the shop at a different folder.
{% endhint %}
