# Configuration

### All configuration is done in the \`config.lua\` file. This page covers every available setting.

### General Settings

| Setting                | Type    | Default   | Description                                                    |
| ---------------------- | ------- | --------- | -------------------------------------------------------------- |
| `Config.Debug`         | boolean | `false`   | Enable debug messages in server/client console                 |
| `Config.Framework`     | string  | `'auto'`  | Framework detection: `'auto'`, `'qb'`, `'esx'`, `'standalone'` |
| `Config.Locale`        | string  | `'en'`    | Language: `'en'` (English) or `'tr'` (Turkish)                 |
| `Config.CommandPrefix` | string  | `'event'` | Prefix for server console commands                             |

```lua
Config.Debug = false
Config.Framework = 'auto'
Config.Locale = 'en'
Config.CommandPrefix = 'event'
```

### Admin Groups

Players in these groups can access the admin panel and use management commands.

```
Config.AdminGroups = {
    'admin',
    'superadmin',
    'god',
    'owner'
}
```

For standalone servers, ACE permissions are used:

```
add_ace group.admin aura.admin allow
```

### Commands & Keybinds

#### Player Dashboard

| Setting       | Type    | Default             | Description                      |
| ------------- | ------- | ------------------- | -------------------------------- |
| `enabled`     | boolean | `true`              | Enable the dashboard command     |
| `command`     | string  | `'events'`          | Chat command to toggle dashboard |
| `key`         | string  | `'F7'`              | Keyboard shortcut                |
| `description` | string  | `'Event Dashboard'` | Keybind description in settings  |

#### Admin Panel

| Setting       | Type           | Default               | Description                              |
| ------------- | -------------- | --------------------- | ---------------------------------------- |
| `enabled`     | boolean        | `true`                | Enable the admin panel command           |
| `command`     | string         | `'eventadmin'`        | Chat command to open admin panel         |
| `key`         | string/boolean | `false`               | Keyboard shortcut (false = command only) |
| `description` | string         | `'Event Admin Panel'` | Keybind description                      |

#### Event Management

| Setting       | Type    | Default              | Description                               |
| ------------- | ------- | -------------------- | ----------------------------------------- |
| `enabled`     | boolean | `true`               | Enable management commands                |
| `command`     | string  | `'event'`            | Base command (e.g., /event start airdrop) |
| `description` | string  | `'Event Management'` | Command description                       |

```
Config.Commands = {
    dashboard = {
        enabled = true,
        command = 'events',
        key = 'F7',
        description = 'Event Dashboard',
    },
    admin = {
        enabled = true,
        command = 'eventadmin',
        key = false,
        description = 'Event Admin Panel',
    },
    manage = {
        enabled = true,
        command = 'event',
        description = 'Event Management',
    },
}
```

### Scheduler Settings

The scheduler automatically starts random events at configurable intervals.

| Setting               | Type    | Default | Description                                |
| --------------------- | ------- | ------- | ------------------------------------------ |
| `enabled`             | boolean | `true`  | Enable automatic event scheduling          |
| `minInterval`         | number  | `30`    | Minimum wait between events (minutes)      |
| `maxInterval`         | number  | `60`    | Maximum wait between events (minutes)      |
| `minPlayers`          | number  | `5`     | Minimum online players required to start   |
| `maxActiveEvents`     | number  | `2`     | Maximum events running at the same time    |
| `announceBeforeStart` | number  | `2`     | Announce this many minutes before starting |

```
Config.Scheduler = {
    enabled = true,
    minInterval = 30,
    maxInterval = 60,
    minPlayers = 5,
    maxActiveEvents = 2,
    announceBeforeStart = 2,
}
```

**How the scheduler works:**

1. Waits a random time between minInterval and maxInterval
2. Checks if minPlayers are online
3. Checks if active events are below maxActiveEvents
4. Picks a random enabled event type that isn't already running
5. Optionally sends a pre-announcement
6. Starts the event

### Notification Settings

| Setting        | Type    | Default | Description                          |
| -------------- | ------- | ------- | ------------------------------------ |
| `type`         | string  | `'gta'` | Notification library to use          |
| `sound`        | boolean | `true`  | Play sound effects on notifications  |
| `blipFlash`    | boolean | `true`  | Flash event blips on the map         |
| `screenEffect` | boolean | `true`  | Show screen effects on announcements |

```
Config.Notifications = {
    type = 'gta',
    sound = true,
    blipFlash = true,
    screenEffect = true,
}
```

**Notification type options:**

| Value    | Library Used                               |
| -------- | ------------------------------------------ |
| `'auto'` | Auto-detect (ox\_lib → QBCore → ESX → GTA) |
| `'ox'`   | ox\_lib notifications                      |
| `'qb'`   | QBCore notifications                       |
| `'esx'`  | ESX notifications                          |
| `'gta'`  | GTA native notifications                   |

***

### Database Settings

| Setting    | Type    | Default     | Description             |
| ---------- | ------- | ----------- | ----------------------- |
| `enabled`  | boolean | `true`      | Enable database logging |
| `resource` | string  | `'oxmysql'` | MySQL resource name     |

```
Config.Database = {
    enabled = true,
    resource = 'oxmysql',
}
```

### Discord Webhook Settings

| Setting          | Type    | Default          | Description                    |
| ---------------- | ------- | ---------------- | ------------------------------ |
| `enabled`        | boolean | `true`           | Enable Discord webhook logging |
| `webhook`        | string  | `''`             | Your Discord webhook URL       |
| `logEventStart`  | boolean | `true`           | Log when events start          |
| `logEventEnd`    | boolean | `true`           | Log when events end            |
| `logEventClaim`  | boolean | `true`           | Log when rewards are claimed   |
| `logAdminAction` | boolean | `true`           | Log admin panel actions        |
| `botName`        | string  | `'Elena Events'` | Webhook bot display name       |
| `botAvatar`      | string  | `''`             | Webhook bot avatar URL         |
| `serverName`     | string  | `'Your Server'`  | Server name shown in embeds    |

```
Config.Discord = {
    enabled = true,
    webhook = 'YOUR_DISCORD_WEBHOOK_URL',
    logEventStart = true,
    logEventEnd = true,
    logEventClaim = true,
    logAdminAction = true,
    colors = {
        airdrop = 16744243,
        hotzone = 16724787,
        convoy = 4488447,
        treasure = 11141375,
        admin = 16776960,
        success = 65280,
        error = 16711680,
    },
    botName = 'Elena Events',
    botAvatar = '',
    serverName = 'Your Server',
}
```

### Announcement Settings

Event titles are configured here. Subtitles and end messages use the Translate system based on Config.Locale.

```
Config.Announcement = {
    title = {
        airdrop = '🪂 AIRDROP',
        hotzone = '🔥 HOTZONE',
        convoy = '🚛 ARMORED CONVOY',
        treasure = '🗺️ TREASURE HUNT',
    },
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://elena-scripts.gitbook.io/elenascripts/core-systems/el-events/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
