> 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/hosting-an-event.md).

# Hosting an Event

Host an event with CAS Event System: use the event permit, fill in the name, date and location, and put tickets on sale at the location's booth.

Any player holding an **event permit** (`event_creator`) can host an event. Give permits to event organisers, saloon owners or staff, however your server runs events.

## Creating the event

1. Use the event permit from the inventory. The **Create Ticket Event** form opens, and the permit is used up.
2. Fill in:
   * **Event Name**: what players will see at the ticket booth and on their ticket.
   * **Event Date**: the day and the start time, in 10-minute steps.
   * **Event Location**: one of the locations from `Config.Locations`.
3. Press **Create Ticket Event**. You get "Event created successfully." and the tickets go on sale at that location's ticket booth.

{% hint style="warning" %}
The permit is used up as soon as the form opens. Fill in the form before you close it, or you'll need a new permit.
{% endhint %}

## Tickets and price

The number of tickets and their price come from the location you choose:

* `ticketAmount` and `ticketPrice` on the location in `Config.Locations`.
* If the location doesn't set them, `Config.DefaultTicketAmount` and `Config.DefaultTicketPrice` are used.

Every ticket sold pays its price to the host. If the host is online, the money is added to their cash with a notification. If they are offline, it is added to their character in the database.

## Rules

* **One event at a time.** A host can't create a new event until 10 minutes after their current one has started.
* **Server time.** The event starts when the server's clock reaches the chosen time. If your players are in a different time zone from the server, pick the start time in server time.
* **Old events are cleared.** When the resource starts, events that started more than 10 minutes ago are removed from the database.

Hosts are recognised by their character, so the event belongs to the character that created it.
