# configuration

All configuration lives in `config.lua`. This file is escrow-ignored so you can freely edit it.

## General

```lua
Config.checkForUpdates = true -- Check GitHub for updates on start
Config.BoomboxItem = 'boombox' -- Inventory item name
Config.InstructionNotification = true -- Show "Press E to drop" hint
```

| Key                       | Type    | Default     | Description                                                                                           |
| ------------------------- | ------- | ----------- | ----------------------------------------------------------------------------------------------------- |
| `checkForUpdates`         | boolean | `true`      | Checks for script updates on resource start                                                           |
| `BoomboxItem`             | string  | `'boombox'` | The inventory item name that triggers the boombox. Must match your database exactly (case-sensitive). |
| `InstructionNotification` | boolean | `true`      | Shows a notification hint when a player picks up the boombox prop                                     |

## Framework

```lua
Config.Framework = 'auto'
```

| Value    | Behavior                                                             |
| -------- | -------------------------------------------------------------------- |
| `'auto'` | Auto-detects ESX or QBCore at runtime — recommended for most servers |
| `'ESX'`  | Forces ESX — requires `es_extended` to be running                    |
| `'qb'`   | Forces QBCore — requires `qb-core` to be running                     |

{% hint style="info" %}
`'auto'` is recommended. Only set manually if auto-detection causes issues on your specific server setup.
{% endhint %}

## Target System

```lua
Config.TargetSystem = 'auto'
```

| Value         | Description                                                                                 |
| ------------- | ------------------------------------------------------------------------------------------- |
| `'auto'`      | Detects first available target resource in priority order: ox\_target → qtarget → qb-target |
| `'ox_target'` | Force ox\_target                                                                            |
| `'qtarget'`   | Force qtarget                                                                               |
| `'qb-target'` | Force qb-target                                                                             |
| `'none'`      | Disables interaction zones entirely — boomboxes still play audio                            |

## Notification System

```lua
Config.NotifySystem = 'auto' -- Only used when Config.NotifySystem = 'custom'
Config.CustomNotify = function(title, description, ntype)
  -- exports['my-notify']:Send(title, description, ntype, 5000)
end
```

| Value      | Resource                                                |
| ---------- | ------------------------------------------------------- |
| `'auto'`   | Priority: ox\_lib → okokNotify → mythic → ESX/QB → chat |
| `'ox_lib'` | Uses `lib.notify` from ox\_lib                          |
| `'okok'`   | Uses okokNotify                                         |
| `'mythic'` | Uses mythic\_notify                                     |
| `'esx'`    | Uses ESX built-in notifications                         |
| `'qb'`     | Uses QBCore built-in notifications                      |
| `'custom'` | Calls your `Config.CustomNotify` function               |

## Admin Permission

```lua
Config.IsAdmin = function(source)
  -- Default: uses framework detection automatically.
  -- Override with your own logic, e.g.:
  -- return IsPlayerAceAllowed(source, 'moh-boombox.admin')
  return nil -- nil = use automatic framework-based check
end
```

By default, admin detection uses your framework's built-in role system — ESX checks for `admin` / `superadmin` group; QBCore checks for `admin` / `god` permission.

**ACE permissions override:**

```lua
-- config.lua
Config.IsAdmin = function(source)
  return IsPlayerAceAllowed(source, 'moh-boombox.admin')
end
```

```cfg
# server.cfg
add_ace group.admin moh-boombox.admin allow
```

## Discord Webhook

```lua
Config.Webhook = 'WEBHOOK_HERE' -- Your Discord webhook URL
Config.BotUsername = 'Moh Boombox' -- Bot display name in Discord
Config.LogPlays = true -- Enable/disable play logging
```

{% hint style="info" %}
To create a webhook: Discord channel settings → Integrations → Webhooks → New Webhook → copy URL → paste into `Config.Webhook`.
{% endhint %}

## Zone & Interaction Settings

```lua
Config.ZoneSize = 1.0 -- Box zone width/length (metres)
Config.ZoneHeight = 0.9 -- Box zone half-height offset (metres)
Config.InteractDist = 1.5 -- Max distance to show target options
Config.PickupDist = 3.0 -- Radius to detect closest boombox on pickup
Config.SoundCheckInterval = 10000 -- Entity existence check interval (ms)
```

| Key                  | Type    | Default | Description                                                  |
| -------------------- | ------- | ------- | ------------------------------------------------------------ |
| `ZoneSize`           | float   | `1.0`   | Width and length of the interaction box zone in metres       |
| `ZoneHeight`         | float   | `0.9`   | Vertical half-extent of the zone above and below the boombox |
| `InteractDist`       | float   | `1.5`   | Maximum distance at which target interaction options appear  |
| `PickupDist`         | float   | `3.0`   | Search radius for nearest boombox when a player picks up     |
| `SoundCheckInterval` | integer | `10000` | Milliseconds between entity-alive checks for auto-cleanup    |


---

# 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://mohssins.gitbook.io/mohscriptsdocs/moh-boombox/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.
