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

# Commands

CAS Owned Shops commands and keys: /createstore, /removestore and /hirenewowner, who can use them, and the G and J prompts.

| Command                              | What it does                                                                  |
| ------------------------------------ | ----------------------------------------------------------------------------- |
| `/createstore <playerId> <pedModel>` | Creates a player-owned shop 1.5 m in front of you, owned by `<playerId>`.     |
| `/removestore <storeId>`             | Deletes the shop with that id, with its shopkeeper, blip, stock and cash box. |
| `/hirenewowner <playerId> <storeId>` | Adds `<playerId>` as a co-owner of the shop.                                  |

`/createstore` and `/removestore` only work for the identifiers in `Config.WhoCanCreateStore`. `<playerId>` is a server id. `<storeId>` is the shop's number in the `cas_ownedshops` table. It also appears in the Discord log when the shop is created.

The command names can be changed in `Config.Commands`:

```lua
Config.Commands = {
    hirenewPartner = "hirenewowner",
    createStore = "createstore",
    removestore = "removestore",
}
```

Chat suggestions for all three commands are added when the resource starts.

## Keys

| Key     | Where              | What it does                 |
| ------- | ------------------ | ---------------------------- |
| **G**   | Any shop counter   | Opens the store.             |
| **J**   | A shop you own     | Opens the management screen. |
| **Esc** | In the shop screen | Closes it.                   |

The two prompt keys are set in `client/client.lua` with `PromptSetControlAction` (`0x760A9C6F` for G and `0xF3830D8E` for J).
