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

# Configuration

CAS Event System configuration: event locations and ticket booths, ticket numbers and prices, host approval, routing bucket, items, webhook and language.

Settings live in two files. Restart the resource after you change them.

## Locations: `config/shared_config.lua`

Each entry in `Config.Locations` is a place where events can be held, with its own ticket booth:

```lua
Config.Locations = {
    [1] = {
        coords = {x = -308.273, y = 802.697, z = 118.979},
        radius = 20.0,
        name = "Saint Denis Saloon",
        ticketAmount = 30,
        ticketPrice = 10,
        shop = {
            coords = { x = -308.87, y = 797.62, z = 118.96 - 0.98, heading = 189.03 },
            ped = nil,
            pedHash = "ge_delloboparty_females_01",
        }
    },
}
```

| Field          | What it does                                                                                                                                                             |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `coords`       | Centre of the event area.                                                                                                                                                |
| `radius`       | Size of the event area in metres. Tickets can only be used inside it, and guests who leave it return to the normal world.                                                |
| `name`         | The location's name, shown in the event form, at the booth and on the ticket. Events are saved under this name, so don't rename a location while it has upcoming events. |
| `ticketAmount` | Tickets per event at this location.                                                                                                                                      |
| `ticketPrice`  | Price of one ticket.                                                                                                                                                     |
| `shop.coords`  | Where the ticket seller stands, with `heading`.                                                                                                                          |
| `shop.pedHash` | Ticket seller model.                                                                                                                                                     |
| `shop.ped`     | Filled in by the script. Leave it as `nil`.                                                                                                                              |

## Other options: `config/shared_config.lua`

| Option                        | Default | What it does                                                                          |
| ----------------------------- | ------- | ------------------------------------------------------------------------------------- |
| `Config.Locale`               | `"en"`  | Language of the notifications and the form.                                           |
| `Config.DefaultTicketAmount`  | `50`    | Tickets per event when the location has no `ticketAmount`.                            |
| `Config.DefaultTicketPrice`   | `5`     | Ticket price when the location has no `ticketPrice`.                                  |
| `Config.CheckTicketByCreator` | `true`  | The host approves each ticket in person. `false` lets valid tickets in automatically. |
| `Config.RoutingBucket`        | `71`    | The routing bucket used for the event area. Pick a number no other resource uses.     |

`Config.GiveTicketsToCreator` is not used in this version.

## Items and logs: `config/server_config.lua`

| Option                  | Default              | What it does                      |
| ----------------------- | -------------------- | --------------------------------- |
| `TicketCreatorItemName` | `"event_creator"`    | The event permit item.            |
| `TicketItemName`        | `"event_ticket"`     | The ticket item.                  |
| `Webhook`               | `""`                 | Discord webhook URL for the logs. |
| `WebhookHeader`         | `"Event Log System"` | Footer text of each log message.  |

`amountOfTickets` is not used in this version. Ticket numbers come from the location or `Config.DefaultTicketAmount`.

The webhook logs every new event, every ticket sold, and every guest who enters or leaves an event area.

## Language

`config/locale.lua` ships in English. To translate it, copy the `["en"]` block, give it a new code, translate the values, and set `Config.Locale` to that code.
