> For the complete documentation index, see [llms.txt](https://tefox-scripts.gitbook.io/tefox-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tefox-scripts.gitbook.io/tefox-scripts-docs/tefox-scripts-documentation/tefox_dailyrewards/configuration.md). Agents can also search and read this documentation through its [MCP server](https://tefox-scripts.gitbook.io/tefox-scripts-docs/~gitbook/mcp).

# Configuration

### **Core:**

| Option             | Description                                                                                                                                        |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Locale`    | Language: `en`, `pl`, `ar`, `de`, `es`, `fr`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `pt`, `pt-br`, `ro`, `ru`, `sr`, `th`, `tl`, `tr`, `cs`, `zh-cn` |
| `Config.Framework` | `auto`, `qb`, `qbox`, `esx`                                                                                                                        |
| `Config.Inventory` | `auto`, `ox`, `qb`, `qs`, `ps`, `lj`, `codem`, `tgiann`, `origen`, `core`, `esx`, `custom`                                                         |
| `Config.Command`   | Command that opens the menu                                                                                                                        |
| `Config.Keybind`   | Default key (players can change it in their FiveM settings)                                                                                        |

### **Reset timing**

| Option                 | Description                                                                                                                                                |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.ResetMode`     | `fixed`: new reward every day at `ResetTime`. `rolling`: `CooldownHours` after the last claim                                                              |
| `Config.ResetTime`     | Server time, `HH:MM`                                                                                                                                       |
| `Config.CooldownHours` | Hours between claims when `ResetMode = 'rolling'`                                                                                                          |
| `Config.CycleMode`     | After the last day: `restart` (back to day 1) or `hold` (repeat the last day)                                                                              |
| Config.MissedDays      | keep: players keep their progress no matter how long they are away. reset: missing a day sends them back to day 1 and their unclaimed VIP rewards are lost |
| Config.GraceHours      | With reset only: hours a player has to claim once a reward unlocks. 24 = missing one day resets the streak, 48 = players can skip one day                  |

{% hint style="info" %}
Players who bought the VIP Pass keep it when their streak resets.
{% endhint %}

### **Rewards:**

```lua
[7] = {
    milestone = true,
    free = {
        { type = 'money', account = 'bank', amount = 1500 },
    },
    vip = {
        { type = 'money', account = 'bank', amount = 4000 },
        { type = 'item', item = 'lockpick', amount = 2 },
    },
},
```

| Type     | Fields                                                  |
| -------- | ------------------------------------------------------- |
| `item`   | `item`, `amount`                                        |
| `weapon` | `item`, `ammo`                                          |
| `money`  | `account` (`cash`, `bank`, `black_money` ...), `amount` |

🔹 `label` is optional. It is read from your inventory automatically.

🔹 A day with no <mark style="color:$info;">`free`</mark> rewards becomes a **VIP-only day**. Normal players still keep their streak.

🔹 If no day has `vip` rewards, the VIP row is hidden.

🔹 Up to 4 rewards per cell are recommended so the layout stays clean.

#### Theme

Every color of the UI can be changed in `Config.Theme` with HEX values. Replace <mark style="color:yellow;">`ui/images/logo.png`</mark> with your server logo, or set `Logo` to an image URL.

### **👑 VIP:**

There are two kinds of VIP:

| Type              | How                                                      | Duration                            |
| ----------------- | -------------------------------------------------------- | ----------------------------------- |
| **VIP Pass**      | `dailyvip [id]` command (in-game chat, console or Tebex) | Current 30-day pass only            |
| **Permanent VIP** | ACE, Discord ID, license, Discord role or your own check | Every pass, as long as they have it |

{% hint style="info" %}
A player who gets the VIP Pass on day 18 unlocks the VIP rewards of days 1 to 18 right away and can claim them one by one or with **Claim all VIP**. Any unclaimed VIP rewards are given automatically when they claim the last day of the pass.
{% endhint %}

#### Permanent VIP options (`config.lua`)

```lua
Config.VIP = {
    Ace      = 'tefox.dailyrewards.vip',
    Discord  = { '123456789012345678', '987654321098765432' },
    Licenses = { 'license:abc123...' },
    Check    = function(src) return exports['my_vip']:IsVip(src) end,
    StoreUrl = 'store.yourserver.com',
}
```

🔹 **ACE:** <mark style="color:$info;">`add_ace group.vip tefox.dailyrewards.vip allow`</mark>

🔹 **Discord ID:** Discord settings → Advanced → enable Developer Mode → right click a user → Copy User ID

🔹 **License:** txAdmin → Players → select the player

🔹 **StoreUrl:** shown to non-VIP players (store, Discord invite...). Leave empty to hide it.

#### Discord roles (`config_server.lua`)

1. Create a bot at the [Discord Developer Portal](https://discord.com/developers/applications), copy its token and enable **Server Members Intent**.
2. Invite the bot to your Discord server.
3. With Developer Mode on, copy your **Server ID** and the **Role IDs** that grant VIP.
4. Fill in <mark style="color:$info;">`ServerConfig.DiscordRoles`</mark><mark style="color:$info;">.</mark>

Keep the bot token in `config_server.lua` only. This file is never sent to players.

#### Selling the VIP Pass with Tebex

In your Tebex package, add a game server command:

```lua
dailyvip {sid}
```

and enable **Require player to be online**. Check the exact player variable name in your Tebex panel.

### 🎯 Missions:

Missions count **active playtime only**. The timer pauses after <mark style="color:$info;">`AfkMinutes`</mark> without movement or input.

```lua
Config.Missions = {
    Enabled        = true,
    AfkMinutes     = 5,
    WeeklyResetDay = 'monday',
    Daily = {
        { id = 'play_1h', minutes = 60,
          rewards = { { type = 'money', account = 'cash', amount = 1000 } },
          vip     = { { type = 'item', item = 'armor', amount = 1 } } },
    },
    Weekly = { ... },
}
```

🔹 `id` must be unique in each list.

🔹 `label` is optional ("Play for 1 hour" is generated automatically).

🔹 Daily missions reset at <mark style="color:$info;">`Config.ResetTime`</mark>, weekly missions on `WeeklyResetDay`.

### 🔔 Reminders:

Players are reminded when their daily reward, VIP rewards or missions are waiting.

```lua
Config.Reminders = {
    Enabled  = true,
    OnJoin   = true, -- remind players shortly after they load in
    Interval = 10,   -- minutes between reminders (0 = only on join)
}
```

Players who have nothing to claim are never reminded.

### 📜 Discord Logs:

Set your webhook in <mark style="color:$info;">`config_server.lua`</mark><mark style="color:$info;">:</mark>

```lua
ServerConfig.Webhook = {
    Enabled = true,
    Url     = 'https://discord.com/api/webhooks/...',
    Name    = 'Daily Rewards',
    Avatar  = '',
}
```

Each log type (`claim`, `vip`, `mission`, `admin`, `error`) can be turned off, recolored or sent to its own webhook. Claims made by VIP players use `VipColor`.

### 🛡️ Commands:

| Command                  | Description                                       |
| ------------------------ | ------------------------------------------------- |
| `/daily`                 | Open the menu                                     |
| `dailyvip [id]`          | Give the VIP Pass for the player's current pass   |
| `dailyunvip [id]`        | Remove the VIP Pass                               |
| `dailyreset [id]`        | Reset a player to day 1 (keeps their VIP Pass)    |
| `dailysetday [id] [day]` | Move a player to a day, they can claim right away |
| `dailyinfo [id]`         | Show a player's status                            |

Admin commands work from the server console. In game they need ACE permission:

```lua
add_ace group.admin command.dailyvip allow
add_ace group.admin command.dailyunvip allow
add_ace group.admin command.dailyreset allow
add_ace group.admin command.dailysetday allow
add_ace group.admin command.dailyinfo allow
```

### 🎒 Custom Inventory:

If your inventory is not supported:

1. Set `Config.`<mark style="color:green;">`Inventory`</mark>` ``=`` `<mark style="color:blue;">`'custom'`</mark>.
2. Open <mark style="color:yellow;">`bridge/inventory/custom.lua`</mark> and replace the exports with your inventory's exports.

All files in <mark style="color:yellow;">`bridge/`</mark> are open, so you can also adjust a supported inventory if its exports changed.

### 🌍 Languages:

Set `Config.Locale` to your language. To edit any text or add a language, open the `locales/` folder. Missing texts fall back to English automatically.

### ❓ Troubleshooting:

| Problem                           | Solution                                                                                                                                   |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| "Daily rewards are still loading" | Make sure `oxmysql` starts before this resource and check the server console for <mark style="color:$info;">`Database ready.`</mark>       |
| A reward item is not given        | The item name may not exist in your inventory. Check the server console on start for a list of missing items, and your Discord error logs. |
| Item images not showing           | Add a PNG with the item name to <mark style="color:yellow;">`ui/images/items/`</mark>                                                      |
| VIP role not detected             | Check that the bot is in your server, Server Members Intent is on, and the player has Discord linked to FiveM                              |

### 💬 Support:

Need help or want to see what's new? Join our Discord:

[**discord.gg/3ZrSPtjvjx**](https://discord.gg/3ZrSPtjvjx)
