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

# Installation

Install CAS Event System on your RedM VORP server: cas\_fwlibs, vorp\_menu, the event permit and ticket items, server.cfg order and first checks.

## Requirements

| Resource                                                   | Needed for                                                                                                                           |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `vorp_core` + `vorp_inventory`                             | Players, money and the two items.                                                                                                    |
| [`cas_fwlibs`](https://github.com/codeaftersex/cas_fwlibs) | Shared CAS framework functions. See [Please read first](https://code-after-sex.gitbook.io/script-documentation/scripts/please-read). |
| `oxmysql`                                                  | Saving events.                                                                                                                       |
| `vorp_menu`                                                | The ticket booth menu.                                                                                                               |

## Steps

1. Put the `cas-eventticket` folder in your resources folder, for example `resources/[CAS]/cas-eventticket`.
2. Add the two items to your `items` table. The names must match `Config.TicketCreatorItemName` and `Config.TicketItemName` in `config/server_config.lua`:

```sql
INSERT INTO `items` (`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `desc`) VALUES
('event_creator', 'Event Permit', 1, 1, 'item_standard', 1, 'Lets you host a ticketed event.'),
('event_ticket', 'Event Ticket', 10, 1, 'item_standard', 1, 'A ticket to an event.');
```

3. Add item pictures called `event_creator.png` and `event_ticket.png` to `vorp_inventory/html/img/items`.
4. Add the resources to `server.cfg`:

```
ensure oxmysql
ensure vorp_core
ensure vorp_inventory
ensure vorp_menu
ensure cas_fwlibs
ensure cas-eventticket
```

5. Restart the server.

The `cas_events` table is created on the first start, so there is no SQL file to import for it.

## First checks

* The server console prints `[CAS-EVENTS] Table ready`.
* The ticket seller stands at the sample location in the config (the Saint Denis Saloon entry). Walk up to it: the **Open Event Ticket Shop** prompt appears.
* Give yourself an `event_creator` and use it from the inventory. The **Create Ticket Event** form opens.

{% hint style="info" %}
`[CAS-EVENTS] ERROR: Unable to load CASFW` in the console means `cas_fwlibs` is missing or did not start. Install it and start it before `cas-eventticket`.
{% endhint %}
