> 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/cas-owned-shops-and-general-stores.md).

# CAS Owned Shops & General Stores

CAS Owned Shops & General Stores for RedM: player-run shops with stock, a cash box and co-owners, plus NPC general stores. For VORP Core.

**Player-run shops for RedM: players stock their shop from their own inventory, set the prices and collect the takings. NPC general stores run alongside them, set up in the config.**

{% hint style="success" %}
An admin places a shop with one command and gives it to a player. The owner stocks it from their own inventory, and customers shop with a basket. Every sale goes into the shop's cash box. Items keep their durability and metadata. Weapons keep their attachments, serial number and custom name.
{% endhint %}

## Highlights

* **Player-owned shops**: an admin places a shopkeeper NPC and a map blip right where they stand, then assigns the owner.
* **Stock from your own inventory**: list items and weapons with your own label, price, quantity and category.
* **Items stay as they are**: an item at 30% durability sells at 30%. Weapons keep their components, serial number, custom label and description.
* **Cash box**: every sale is paid into the shop, and owners withdraw when they want.
* **Co-owners**: add partners who can manage the shop and withdraw from it.
* **Shop settings**: rename the shop and set a logo image. The map blip takes the new name straight away.
* **Last actions**: a log of every listing, sale, removal, withdrawal and settings change.
* **NPC general stores**: fixed stores defined in the config, each with a shopkeeper, a blip and an item list.
* **Search, categories and a basket** for customers. A server-side lock stops two buyers from paying for the same last item.
* **Discord logs** for new shops, listings, purchases, removals, withdrawals and co-owners.
* **Built for VORP Core** and `vorp_inventory`. Six languages.

## At a glance

|                  |                                                       |
| ---------------- | ----------------------------------------------------- |
| **Framework**    | VORP Core + `vorp_inventory`                          |
| **Dependencies** | `oxmysql`, `uiprompt`                                 |
| **Database**     | One table, `cas_ownedshops` (from `player.sql`)       |
| **Interface**    | React NUI, prebuilt in `web/build` (no build step)    |
| **Keys**         | **G** opens a shop, **J** manages a shop you own      |
| **Languages**    | English, French, Spanish, Italian, German, Portuguese |

## Where to start

| Page                                                                              | What it covers                                                             |
| --------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| [Installation](/script-documentation/cas-owned-shops/installation.md)             | Requirements, the database table, `server.cfg` order and the first checks. |
| [NPC General Stores](/script-documentation/cas-owned-shops/general-stores.md)     | Fixed stores from the config: shopkeeper, blip and item list.              |
| [Player-Owned Shops](/script-documentation/cas-owned-shops/player-owned-shops.md) | Creating a shop, owners and co-owners, removing a shop.                    |
| [Managing a Shop](/script-documentation/cas-owned-shops/managing-a-shop.md)       | Listing stock, removing listings, the cash box, settings and the log.      |
| [Buying](/script-documentation/cas-owned-shops/buying.md)                         | The customer side: search, categories, the basket and checkout.            |
| [Commands](/script-documentation/cas-owned-shops/commands.md)                     | Every command, who can use it, and the keys.                               |
| [Configuration](/script-documentation/cas-owned-shops/configuration.md)           | Every option in `config/shared_config.lua`, languages and Discord logs.    |
| [Troubleshooting](/script-documentation/cas-owned-shops/troubleshooting.md)       | What each message means and how to fix common problems.                    |

## Get the script

Owned Shops & General Stores is sold on the CAS Scripts store: [codeaftersex.com/script/owned-shops-general-stores](https://codeaftersex.com/script/owned-shops-general-stores). Both the Escrow build and the full Open Source build are listed there, with lifetime updates and Discord support.
