> For the complete documentation index, see [llms.txt](https://bros-development.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bros-development.gitbook.io/documentation/scripts/brosdev-daily-rewards/installation.md).

# 📦 Installation

🔧 Installation Guide

Follow the steps below carefully to install **BrosDev Daily Rewards** correctly on your FiveM server.

***

### 📥 Step 1 — Download the Resource

To download the files required for **BrosDev-DailyRewards**, you must access the official **Cfx.re Portal**, where all FiveM assets purchased through Tebex are securely managed and delivered.

All granted assets are stored inside your account dashboard and can be accessed directly through the official portal below:

🔗 <https://portal.cfx.re/assets/granted-assets>

These files include the complete resource package such as scripts, UI components, configuration files, and database structure required for the proper installation and functionality of the system.

After downloading, extract the archive to proceed with the installation steps.

***

### 📂 Step 2 — Place in Resources Folder

Move the extracted folder into your server’s resources directory.

Example:

```bash
resources/
└── [brosdevelopment]/
    └── BrosDev-DailyRewards/
```

Make sure the folder name remains exactly:

```bash
BrosDev-DailyRewards
```

Do not rename the resource.

***

### 🗄️ Step 3 — Import the Database

Inside the resource you will find:

```bash
sql/install.sql
```

Import this SQL file into your server database using:

* phpMyAdmin
* HeidiSQL
* Navicat
* DBeaver
* Command Line

Example command:

```bash
mysql -u root -p your_database < install.sql
```

This will automatically create all required database tables for:

* Player progression
* Reward storage
* Claim history
* XP system
* Vehicle rewards
* Admin settings

***

### ⚙️ Step 4 — Configure server.cfg

Add the resource to your `server.cfg`.

Recommended startup order:

```cfg
ensure oxmysql
ensure ox_lib

# Framework
ensure qbx_core
# or qb-core / es_extended

# Inventory
ensure ox_inventory
# or qs-inventory / quasar / chezza / core_inventory

# Garage & Keys (if used)
ensure qb-garage
ensure qb-vehiclekeys

# Daily Rewards
ensure BrosDev-DailyRewards
```

> ⚠️ Important:\
> Your framework, inventory, garage, and key systems MUST start BEFORE BrosDev-DailyRewards.

***

### 🛠️ Step 5 — Configure config.lua

Open:

```bash
BrosDev-DailyRewards/config.lua
```

Set your framework and integrations manually for best stability.

Example:

```lua
Config.AutoDetectFramework = false
Config.Framework = 'qbox'

Config.AutoDetectInventory = false
Config.Inventory = 'ox'

Config.AutoDetectGarage = false
Config.Garage = 'qb'

Config.AutoDetectKeys = false
Config.Keys = 'qb'
```

Supported frameworks:

* `qbox`
* `qbcore`
* `esx`
* `standalone`

Supported inventories:

* `ox`
* `qs`
* `quasar`
* `chezza`
* `core`

Supported garages:

* `qb`
* `jg`
* `qs`
* `cd`
* `ps`

Supported key systems:

* `qb`
* `qs`
* `jg`
* `cd`

***

### 🔐 Step 6 — Setup Admin Permissions

Grant access to `/dailyadmin`.

#### ACE Permission Method

Add to `server.cfg`:

```cfg
add_ace group.admin command.dailyadmin allow
```

Then assign yourself to the admin group:

```cfg
add_principal identifier.license:YOUR_LICENSE_HERE group.admin
```

***

#### License Whitelist Method

Alternatively, add your license directly inside `config.lua`:

```lua
Config.LicenseAdmins = {
    'license:your_license_here',
}
```

This bypasses ACE permission checks.

***

### 🎨 Step 7 — Add Optional Assets

Inside:

```bash
html/assets/
```

You can add custom files:

#### Logo

```bash
logo.png
```

#### Sidebar Character

```bash
character.png
```

#### Custom Sounds

```bash
sounds/claim.ogg
sounds/hover.ogg
sounds/milestone.ogg
sounds/open.ogg
```

If no custom sounds are added, the script automatically falls back to GTA native audio.

***

### 🚀 Step 8 — Start the Resource

Restart your server or run:

```cfg
restart BrosDev-DailyRewards
```

If installed correctly, the server console should display:

```bash
[brosdev-rewards] ============================================
[brosdev-rewards]  Bros Development - Daily Rewards
[brosdev-rewards]  Resource loaded successfully!
[brosdev-rewards] ============================================
```

***

### ✅ Step 9 — Open the Admin Panel

In-game, use:

```bash
/dailyadmin
```

From here you can:

* Configure all rewards
* Edit every reward day
* Change colors and UI
* Setup Discord webhooks
* Configure cooldowns
* Manage milestones
* Import/export configs
* Manage player streaks

No restart required for most changes.

***

### 🎮 Player Command

Players can open the rewards menu using:

```bash
/dailyrewards
```

***

### ⚠️ Important Notes

* Disable `Config.TestMode` before production release
* Always ensure dependencies start first
* Do not rename the resource folder
* Use manual framework setup for best compatibility
* Ensure ox\_lib is fully updated
* Clear FiveM cache if the UI appears broken after updates
