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

# CAS Event System

CAS Event System for RedM: players host ticketed events, sell tickets at NPC ticket booths and let guests into a private event area.

**Ticketed events for RedM roleplay. A player hosts an event, tickets go on sale at an NPC ticket booth, and guests with a valid ticket enter a private event area.**

{% hint style="success" %}
The host uses an event permit to pick a name, a date and a location. Players buy tickets at that location's ticket booth, and the money goes to the host. At the event, guests use their ticket inside the area, the host checks it, and they are let into a private instance of the world that only ticket holders share.
{% endhint %}

## Highlights

* **Player-hosted events**: anyone holding an event permit can host. They choose the event name, date, time and location in a simple form.
* **Ticket booths**: every event location has an NPC ticket seller that lists its upcoming events, with the date, tickets left and price.
* **Tickets pay the host**: each sale goes to the host straight away, or to their character while they are offline.
* **Real tickets**: each ticket is an inventory item that carries its own number, the event, the location, the date and the host.
* **Host approval**: when a guest shows a ticket, the host sees it on a ticket card and approves or declines it. This can be turned off for automatic entry.
* **Private event area**: approved guests move into their own routing bucket inside the event radius, and go back to the normal world when they leave it.
* **Doors open on time**: tickets are accepted from 10 minutes before the start to 10 minutes after it.
* **Limited seats** per location, with a price you set, and one active event per host.
* **Discord logs** for new events, ticket sales, and guests arriving and leaving.

## At a glance

|                  |                                                                           |
| ---------------- | ------------------------------------------------------------------------- |
| **Framework**    | VORP Core + `vorp_inventory`                                              |
| **Dependencies** | `cas_fwlibs`, `oxmysql`, `vorp_menu`                                      |
| **Database**     | `cas_events`, created on first start                                      |
| **Items**        | `event_creator` (event permit), `event_ticket`                            |
| **Interface**    | React NUI for the event form and the ticket card, prebuilt in `web/build` |

## Where to start

| Page                                                                             | What it covers                                                           |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| [Installation](/script-documentation/cas-event-system/installation.md)           | Requirements, the two items, `server.cfg` order and the first checks.    |
| [Hosting an Event](/script-documentation/cas-event-system/hosting-an-event.md)   | The event permit, the form, ticket numbers and prices.                   |
| [Ticket Booths](/script-documentation/cas-event-system/ticket-booths.md)         | The NPC ticket sellers and buying a ticket.                              |
| [Entering an Event](/script-documentation/cas-event-system/entering-an-event.md) | Using a ticket, host approval and the private event area.                |
| [Configuration](/script-documentation/cas-event-system/configuration.md)         | Locations, prices, the routing bucket, items, the webhook and languages. |
| [Troubleshooting](/script-documentation/cas-event-system/troubleshooting.md)     | What each message means and how to fix common problems.                  |

## Get the script

Event System is sold on the CAS Scripts store: [codeaftersex.com/script/event-system](https://codeaftersex.com/script/event-system). Both the Escrow build and the full Open Source build are listed there, with lifetime updates and Discord support.
