# Installation

## STEP 1 - Dependencies

{% hint style="info" %}
**Dependencies:** It is important to use the dependencies that are indicated in this step, do not use others, otherwise you will receive critical errors
{% endhint %}

{% embed url="<https://github.com/overextended/oxmysql/releases>" %}

{% embed url="<https://github.com/overextended/ox_lib/releases>" %}

## STEP 2 - Start order

{% hint style="warning" %}
It is important to put the resources in the correct order, oxmysql should be started before es\_extended followed by ox\_lib (should be on top of your starting scripts)
{% endhint %}

In order for the resource to start correctly and not receive any errors, we must start the resources in the following order

```
ensure oxmysql
ensure ox_lib
```

## STEP 3 - Database

{% hint style="info" %}
You will need to insert the database that's included into the script and it's called into the

folder: deluxe-rewards.sql

In order to do that you will just need to run this sql in your db
{% endhint %}

```sql
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";

CREATE TABLE `deluxe_rewards` (
  `id` int(11) NOT NULL,
  `identifier` varchar(46) DEFAULT NULL,
  `rewardcount` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


ALTER TABLE `deluxe_rewards`
  ADD PRIMARY KEY (`id`);

ALTER TABLE `deluxe_rewards`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
```

## STEP 4 - Script Config

{% hint style="info" %}
You can fully configure the script based on what your server needs. Here you can find a detailed explaination about all the possible configuration that you can use.
{% endhint %}

````lua
```lua
--[[    
  
           ______________________________________
  ________|           Deluxe Rewards             |_______
  \       |      deluxedevelopment.tebex.io      |      /
   \      |                                      |     /
   /      |______________________________________|     \
  /__________)                                (_________\                                                                           
  
    Discord Support: https://discord.gg/Ypt2m8FjRy

Version 1.0 | FREE RELEASE by Discord: jonyzeratv [Dev & Owner Deluxe Dev]

Before you go ahead make sure you have downloaded and installed these dependency or you might have issues running this script.
1] OXMySQL: https://github.com/overextended/oxmysql/releases
2] OXLib : https://github.com/overextended/ox_lib/releases

Make sure you have in your server cfg:

ensure oxmysql
ensure ox_lib

]]

Config = {}

Config.Framework = 'esx' -- Available: esx, qb 

-- Reward Key Setting
Config.KeyOpenUIMenu = 38 -- Reward Key to get the item [38 = E]	

Config.TimeToReward = 100 -- Time to get each reward

Config.Commands = {
	EnableShowCommand = true, -- Enable command to open UI? true/false
	ShowUICommand = 'showreward', -- Command to hide the reward UI
	EnableHideCommand = true, -- Enable command to close UI? true/false
	HideUICommand = 'hidereward' -- Command to hide the reward UI
}

Config.InventoryType = 'ox' -- Available esx, ox
Config.NotificationType = 'ox' -- Available esx, ox , okok , custom (If you set custom check below the function SetCustomNotification)
Config.OxAlignNotifications = 'center-left' -- Available: 'top' or 'top-right' or 'top-left' or 'bottom' or 'bottom-right' or 'bottom-left' or 'center-right' or 'center-left' [You must have Config.Notificationtype = 'ox']

---[[ You can add infinite rewards and set the item name that the player should receive and the quantity ]]---
---@param name | item name to give
---@param quantity | item quantity to give
Config.Rewards = {
	[0] = { name = 'burger', quantity = 4 },
	[1] = { name = 'money', quantity = 1000 },
	[2] = { name = 'weapon_pistol', quantity = 1 },
	[3] = { name = 'money', quantity = 1000 },
	[4] = { name = 'burger', quantity = 5 },
	[5] = { name = 'weapon_pistol', quantity = 1},
	[6] = { name = 'money', quantity = 500},
	[7] = { name = 'burger', quantity = 10 },
	[8] = { name = 'money', quantity = 1000 },
	[9] = { name = 'burger', quantity = 10 },
	[10] = { name = 'weapon_pistol', quantity = 2},
	-- You can add infinite rewards, when last reward is encountered, then it will start over
}

-- Translate everything according to your language there.
Config.Translation = {
    ["receive_reward"] = "[E] Receive Reward",
	["cant_collect"] = "Can't collect item",
	["you_received"] = "You just received ",
	["reward"] = "Reward: ",
}
```
````

## STEP 5 - Upload Images

```
// To upload items images you will just need to go into the directory
"web/build/images" and upload all the pictures for the items you want to add.
Make sure they are all .png files otherwise it won't load the picture.

```


---

# 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://deluxedevelopment.gitbook.io/api-docs/deluxe-scripts-free/esx-qb-rewards/installation.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.
