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

# Player-Owned Shops

Create player-owned shops in CAS Owned Shops: place a shopkeeper with /createstore, add co-owners, and remove a shop when it closes.

A player-owned shop has a shopkeeper NPC, a map blip, its own stock, a cash box and a list of owners. Every shop is saved in the `cas_ownedshops` table and loads again after a restart.

## Creating a shop

Only the identifiers listed in `Config.WhoCanCreateStore` can create shops (see [Installation](/script-documentation/cas-owned-shops/installation.md)).

1. Stand where the shop counter should be.
2. Run `/createstore <playerId> <pedModel>`, where `<playerId>` is the server id of the player who will own the shop.
3. The shopkeeper appears 1.5 metres in front of you, facing you, and a blip is added to the map for everyone.

A new shop is called **Item Shop**. It starts with the default logo, no stock and an empty cash box, and the owner can rename it straight away. If the ped model does not exist, the shop uses `Config.DefaultPed` instead and tells you so.

## Owners and customers

At a shop's counter (within 3 metres):

* **Open Shop** (**G**) is shown to everyone and opens the store. See [Buying](/script-documentation/cas-owned-shops/buying.md).
* **Manage Shop** (**J**) is shown only to the shop's owners. See [Managing a Shop](/script-documentation/cas-owned-shops/managing-a-shop.md).

Owners are stored by the player's Steam identifier, so a shop belongs to that player on every character.

## Co-owners

`/hirenewowner <playerId> <storeId>` adds another player as a co-owner. `<storeId>` is the shop's number in the database, which is also shown in the Discord log when the shop is created. A co-owner can do everything the first owner can: list and remove stock, withdraw from the cash box and change the settings. The new co-owner gets a notification, and the change is written to the shop's log.

## Removing a shop

`/removestore <storeId>` deletes the shop, its shopkeeper and its blip for everyone. Only the identifiers in `Config.WhoCanCreateStore` can use it.

{% hint style="warning" %}
Removing a shop also deletes its stock and whatever is left in its cash box. Ask the owners to take out their items and withdraw the money first.
{% endhint %}

## Without shopkeepers

Set `Config.EnableOwnedShopPeds = false` to place shops without an NPC. The blip and the prompts still work at the shop's position.
