> For the complete documentation index, see [llms.txt](https://tg-dev.gitbook.io/tg-dev-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tg-dev.gitbook.io/tg-dev-docs/tg-dailydispatch/config.md).

# Config

### Basic Settings

All main settings are in `config/config.lua`.

```lua
Config.General = {
    TestMode = false,
    Command = 'dailydispatch',
    ClaimCooldownHours = 24,
    ResetOnMiss = true,
    MissResetHours = 48,
    OpenReadyOnLoaded = true,
    MoneyAccount = 'money',
    Theme = 'yellow',
}
```

* `Command`: command used by players to open the UI.
* `ClaimCooldownHours`: hours required before the next daily reward is ready.
* `ResetOnMiss`: resets the daily route if a player misses the claim window.
* `MissResetHours`: hours allowed after the last claim before reset can happen.
* `OpenReadyOnLoaded`: opens the UI once after player loaded if the daily reward is ready.
* `MoneyAccount`: money account used by money rewards. QB/Qbox cash conversion is handled by the bridge.
* `Theme`: selected UI color theme.

### Language

Change the active language in `config/lang.lua`:

```lua
Lang.Locale = 'en'
```

Included languages:

* `en`
* `tr`
* `de`
* `fr`
* `es`
* `pt`
* `ru`

All player-facing UI labels and notifications are controlled from `lang.lua`.

### Themes

Themes are configured in `Config.General.Themes`.

```lua
Theme = 'yellow'
```

You can use the included theme names or edit the colors in the theme table. The selected theme is used across buttons, titles, icons, crate UI, badges, and highlights.

### ACE-Only Access

If `AcePermOnly = true`, only players with the configured ACE permission can use Daily Dispatch.

```lua
AcePermOnly = true,
AcePermission = 'tg-dailydispatch.use',
```

Examples:

```cfg
add_ace group.admin tg-dailydispatch.use allow
add_ace identifier.license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx tg-dailydispatch.use allow
```

Players without permission cannot open the menu, claim rewards, open crates, or receive reward-ready notifications.

### Admin Menu

The admin menu command is configured here:

```lua
AdminSettings = {
    Command = 'ddadmin',
}
```

Open it in game:

```
/ddadmin
```

Admin access can use ACE, framework groups, or both.

ACE example:

```cfg
add_ace group.admin tg-dailydispatch.admin allow
add_ace identifier.license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx tg-dailydispatch.admin allow
```

Group example:

```lua
Groups = {
    Enabled = true,
    ['es_extended'] = {'admin', 'superadmin', 'owner'},
    ['qb-core'] = {'admin', 'god'},
    ['qbx_core'] = {'admin', 'god'},
    custom = {'admin'},
}
```

Admin menu features:

* view registered players
* view online/offline state
* set daily day
* set streak crate progress
* make reward ready
* make VIP daily crate ready
* reset player progress
* give/remove VIP

When ACE-only access is enabled, the admin list only shows players who are allowed to use Daily Dispatch.

### VIP System

VIP is managed only from the admin menu.

```lua
VipSettings = {
    Enabled = true,
    Features = {
        DisableResetOnMiss = true,
        BonusDayDoubleReward = true,
        MegaDayDoubleReward = true,
        RandomCrateDoubleReward = true,
        StreakCrateDoubleOpen = true,
        VipDailyCrate = true,
    },
}
```

Feature meaning:

* `DisableResetOnMiss`: VIP players keep daily progress even if they miss the reset window.
* `BonusDayDoubleReward`: VIP players get 2x money/item/weapon rewards on configured bonus days.
* `MegaDayDoubleReward`: VIP players get 2x money/item/weapon rewards on configured mega days.
* `RandomCrateDoubleReward`: VIP players get 2x money/item/weapon rewards from random crates.
* `StreakCrateDoubleOpen`: VIP players can open earned streak crates twice. The crate reward itself is not multiplied.
* `VipDailyCrate`: enables the separate VIP Daily Crate.

Vehicle rewards are never multiplied. A vehicle reward always gives one vehicle.

### Daily Rewards

Daily rewards are configured in `Config.Rewards`.

There should be one reward entry for each day from 1 to 30.

```lua
[1] = {type = 'money', amount = 400, label = '$400'},
[3] = {type = 'item', name = 'bandage', amount = 5, label = 'Bandage'},
[10] = {type = 'weapon', name = 'weapon_knife', amount = 1, label = 'Knife'},
[30] = {type = 'vehicle', name = 'adder', label = 'Adder', category = 'car'},
```

Reward types:

* `money`: adds money to `Config.General.MoneyAccount`
* `item`: adds an inventory item
* `weapon`: adds a weapon item without metadata
* `vehicle`: registers a vehicle to the player
* `random`: opens `Config.Rewards.RandomCrate`

Item, weapon, and vehicle rewards must have a `label`. Do not write the amount in the item label. The UI automatically displays amount labels such as `5X Bandage`.

Reward images are loaded from:

```
html/images/items/<reward name>.png
```

Examples:

```
html/images/items/bandage.png
html/images/items/weapon_knife.png
html/images/items/adder.png
html/images/items/random.png
```

### Bonus And Mega Days

Bonus and mega days are fully configurable:

```lua
SpecialDays = {
    Bonus = {5, 15, 25},
    Mega = {10, 20, 30},
}
```

These values control:

* road line icons
* bottom legend text
* VIP 2X badges
* VIP bonus/mega multiplier checks

### Random Crate

Use a random crate by setting a daily reward to:

```lua
{type = 'random'}
```

The crate contents are configured in:

```lua
Config.Rewards.RandomCrate = {
    Rewards = {
        {type = 'item', name = 'bandage', amount = 5, label = 'Bandage', chance = 60},
        {type = 'money', amount = 10000, label = '$10000', chance = 20},
    }
}
```

`chance` is checked per reward from 0 to 100. The total does not need to be 100.

### Streak Crate

The streak crate is configured in:

```lua
Config.Rewards.BonusCrate = {
    RequiredStreak = 7,
    Rewards = {
        {type = 'item', name = 'repairkit_car', amount = 2, label = 'Repair Kit', chance = 50},
    }
}
```

Players earn crate openings by claiming the required number of consecutive daily rewards.

### VIP Daily Crate

VIP Daily Crate is configured in:

```lua
Config.Rewards.VipDailyCrate = {
    Rewards = {
        {type = 'item', name = 'bandage', amount = 10, label = 'Bandage', chance = 60},
    }
}
```

Only VIP players can see and open this crate when the VIP feature is enabled.

The cooldown uses `Config.General.ClaimCooldownHours`.

### Vehicle Rewards

Vehicle rewards use `Config.General.VehicleStorage`.

```lua
VehicleStorage = {
    System = 'auto',
    DefaultState = 1,
    VehicleGarages = {
        car = 'pillboxgarage',
        boat = 'boatgarage',
        heli = 'airgarage',
        plane = 'airgarage',
    },
}
```

`System` options:

* `auto`
* `es_extended`
* `qb-core`
* `qbx_core`
* `custom`

Reward example:

```lua
{type = 'vehicle', name = 'adder', label = 'Adder', category = 'car'}
```

`category` is free text. If you add a custom category, add a matching garage:

```lua
VehicleGarages = {
    police = 'policegarage',
}
```

Then use:

```lua
{type = 'vehicle', name = 'police', label = 'Police Cruiser', category = 'police'}
```

ESX notes:

* `owned_vehicles.type` is used when `typeColumn = 'type'` is enabled.
* Some ESX garage systems require a garage column. Enable `garageColumn = 'garage'` only if your table has that column.

QB/Qbox notes:

* `player_vehicles.garage` is used when `garageColumn = 'garage'` is configured.
* If your table has a vehicle type column, enable `typeColumn = 'type'`.

Custom storage:

* Set `VehicleStorage.System = 'custom'`.
* Fill `VehicleStorage.AddVehicle`.
* Return `true` when the vehicle is saved successfully.

### Player Settings

Players can change these settings from the gear button in the UI:

* Sounds
* Reward Ready Notify
* Auto Open When Reward Ready

Settings are saved per player with KVP, so they stay after reconnecting.

Reward-ready notifications repeat every 5 minutes while the reward is ready and unclaimed. VIP Daily Crate ready notifications also repeat every 5 minutes until the crate is opened.

### Logs

Log settings are at the bottom of `config/config.lua`.

```lua
Config.Logs = {
    Enabled = true,

    Discord = {
        Enabled = false,
        Webhook = '',
    },

    FiveManage = {
        Enabled = false,
    },
}
```

Discord logs require a webhook URL. FiveManage logs require the `fmsdk` resource to be started.

Available log events can be enabled or disabled from `Config.Logs.Events`:

* daily reward claims
* random crate openings
* streak crate openings
* VIP daily crate openings
* vehicle rewards
* admin actions
* VIP changes
* reward delivery failures
