# Installation

### DEPENDENCIES

> **REQUIRED DEPENDENCIES**

<table data-full-width="false"><thead><tr><th>Resource</th><th>Download</th></tr></thead><tbody><tr><td>Apex Library</td><td><a href="https://astudios.tebex.io/package/5541419">Apex Studios Tebex Store</a></td></tr><tr><td>Framework</td><td><a href="https://github.com/qbcore-framework/qb-core">QBCore</a> or <a href="https://github.com/esx-framework/esx_core">ESX</a></td></tr><tr><td>Target</td><td><a href="https://github.com/qbcore-framework/qb-target">qb-target</a> / <a href="https://github.com/overextended/ox_target">ox_target</a></td></tr><tr><td>Menu</td><td><a href="https://github.com/qbcore-framework/qb-menu">qb-menu</a> &#x26; <a href="https://github.com/qbcore-framework/qb-input">qb-input</a> / <a href="https://github.com/overextended/ox_lib">ox_lib</a></td></tr><tr><td>Inventory</td><td><ul><li><a href="https://github.com/qbcore-framework/qb-inventory">qb-inventory</a></li><li><a href="https://github.com/loljoshie/lj-inventory">lj-inventory</a></li><li><a href="https://github.com/Project-Sloth/ps-inventory">ps-inventory</a></li><li><a href="https://github.com/overextended/ox_inventory">ox_inventory</a></li><li><a href="https://buy.quasar-store.com/category/2395209">Quasar Inventory</a></li></ul></td></tr><tr><td>Media player</td><td><a href="https://github.com/Xogy/xsound">xsound</a></td></tr></tbody></table>

> **OPTIONAL DEPENDENCIES**

| Resource | Download                                                                     |
| -------- | ---------------------------------------------------------------------------- |
| Mapping  | [Juniors Interios](https://interiors.juniordevelopments.com/package/5008741) |

### RESOURCE INSTALLATION GUIDE

> **1) RESOURCE DOWNLOAD**

{% hint style="info" %}
Download your resource from [FiveM's Keymaster](https://keymaster.fivem.net/asset-grants).
{% endhint %}

> **2) RESOURCE POSITIONING**

{% hint style="info" %}
**You need  to make sure that apex\_lib is always started before any of our scripts!**

```lua
ensure apex_lib
ensure [apex] -- or ensure apex_emerald
```

{% endhint %}

> **3) ASSET ADDING**

{% hint style="info" %}

1. Open apex\_emerald > assets > inventory\_images
2. Copy files from the folder and add them into your inventory image folder
   {% endhint %}

> **4) ITEM ADDING (QBCORE & ESX)**
>
> The first block shows the data, you'll have to put into shared/items.lua in **qbcore**
>
> The second block shows the data, you'll have to put into the database in **esx**

{% hint style="info" %}

```lua
--[DRINK INGREDIENTS]--
["ice"] 		= {["name"] = "ice", 		["label"] = "Ice", 		["weight"] = 10, ["type"] = "item", ["image"] = "ice.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["pineapplejuice"] 	= {["name"] = "pineapplejuice", ["label"] = "Pineapple Juice", 	["weight"] = 10, ["type"] = "item", ["image"] = "pineapplejuice.png", 	["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["lemon"] 		= {["name"] = "lemon", 		["label"] = "Lemon", 		["weight"] = 10, ["type"] = "item", ["image"] = "lemon.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["lime"] 		= {["name"] = "lime", 		["label"] = "Lime", 		["weight"] = 10, ["type"] = "item", ["image"] = "lime.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["sugar"] 		= {["name"] = "sugar", 		["label"] = "Sugar", 		["weight"] = 10, ["type"] = "item", ["image"] = "sugar.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["mint"] 		= {["name"] = "mint", 		["label"] = "Mint", 		["weight"] = 10, ["type"] = "item", ["image"] = "mint.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["cocomilk"] 		= {["name"] = "cocomilk", 	["label"] = "Coco Milk", 	["weight"] = 10, ["type"] = "item", ["image"] = "cocomilk.png", 	["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
--[DRINKS]--
["bluelagoon"] 		= {["name"] = "bluelagoon", 	["label"] = "Blue Lagoon", 	["weight"] = 30, ["type"] = "item", ["image"] = "bluelagoon.png", 	["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["caipirinha"] 		= {["name"] = "caipirinha", 	["label"] = "Caipirinha", 	["weight"] = 30, ["type"] = "item", ["image"] = "caipirinha.png", 	["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["pinacolada"] 		= {["name"] = "pinacolada", 	["label"] = "Pinã Colada", 	["weight"] = 30, ["type"] = "item", ["image"] = "pinacolada.png", 	["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["maitai"] 		= {["name"] = "maitai", 	["label"] = "Mai Tai", 		["weight"] = 30, ["type"] = "item", ["image"] = "maitai.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["mojito"] 		= {["name"] = "mojito", 	["label"] = "Mojito", 		["weight"] = 30, ["type"] = "item", ["image"] = "mojito.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["sanfrancisco"] 	= {["name"] = "sanfrancisco", 	["label"] = "San Francisco", 	["weight"] = 30, ["type"] = "item", ["image"] = "sanfrancisco.png", 	["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["gin"] 		= {["name"] = "gin", 		["label"] = "Gin", 		["weight"] = 30, ["type"] = "item", ["image"] = "gin.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["rum"] 		= {["name"] = "rum", 		["label"] = "Rum", 		["weight"] = 30, ["type"] = "item", ["image"] = "rum.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["whiskey"] 		= {["name"] = "whiskey", 	["label"] = "Whiskey", 		["weight"] = 30, ["type"] = "item", ["image"] = "whiskey.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
["vodka"] 		= {["name"] = "vodka", 		["label"] = "Vodka", 		["weight"] = 30, ["type"] = "item", ["image"] = "vodka.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Alcoholic Drink"},
--[FOOD INGREDIENTS]--
["onion"] 		= {["name"] = "onion", 		["label"] = "Onion", 		["weight"] = 10, ["type"] = "item", ["image"] = "onion.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["butter"] 		= {["name"] = "butter",         ["label"] = "Butter", 		["weight"] = 10, ["type"] = "item", ["image"] = "butter.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["tofu"] 		= {["name"] = "tofu", 		["label"] = "Tofu", 		["weight"] = 10, ["type"] = "item", ["image"] = "tofu.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["rice"] 		= {["name"] = "rice", 		["label"] = "Rice", 		["weight"] = 10, ["type"] = "item", ["image"] = "rice.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["chicken_fillet"] 	= {["name"] = "chicken_fillet", ["label"] = "Chicken Fillet",   ["weight"] = 10, ["type"] = "item", ["image"] = "chicken_fillet.png",   ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["fish"] 		= {["name"] = "fish", 		["label"] = "Fish", 		["weight"] = 10, ["type"] = "item", ["image"] = "fish.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
["potatos"] 		= {["name"] = "potatos", 	["label"] = "Potatos", 		["weight"] = 10, ["type"] = "item", ["image"] = "potatos.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Ingredients"},
--[FOOD]--
["chickennoodlesoup"]   = {["name"] = "chickennoodlesoup", ["label"] = "Chicken Noodle Soup",  ["weight"] = 10, ["type"] = "item", ["image"] = "chickennoodlesoup.png", ["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Food"},
["misosoup"]            = {["name"] = "misosoup", 	   ["label"] = "Miso Soup",            ["weight"] = 10, ["type"] = "item", ["image"] = "misosoup.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Food"},
["fries"]               = {["name"] = "fries",             ["label"] = "French Fries",         ["weight"] = 10, ["type"] = "item", ["image"] = "fries.png", 		["unique"] = false, ["useable"] = true, ["shouldClose"] = true, ["combinable"] = nil, ["description"] = "Food"},
```

{% endhint %}

{% hint style="info" %}

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('ice', 'Ice', 10, 0, 1),
('pineapplejuice', 'Pineapple Juice', 10, 0, 1),
('lemon', 'Lemon', 10, 0, 1),
('lime', 'Lime', 10, 0, 1),
('sugar', 'Sugar', 10, 0, 1),
('mint', 'Mint', 10, 0, 1),
('cocomilk', 'Coco Milk', 10, 0, 1),
('bluelagoon', 'Blue Lagoon', 10, 0, 1),
('caipirinha', 'Caipirinha', 10, 0, 1),
('pinacolada', 'Pinã Colada', 10, 0, 1),
('maitai', 'Mai Tai', 10, 0, 1),
('mojito', 'Mojito', 10, 0, 1),
('sanfrancisco', 'San Francisco', 10, 0, 1),
('gin', 'Gin', 10, 0, 1),
('rum', 'Rum', 10, 0, 1),
('whiskey', 'Whiskey', 10, 0, 1),
('vodka', 'Vodka', 10, 0, 1),
('onion', 'Onion', 10, 0, 1),
('butter', 'Butter', 10, 0, 1),
('tofu', 'Tofu', 10, 0, 1),
('rice', 'Rice', 10, 0, 1),
('chicken_fillet', 'Chicken Fillet', 10, 0, 1),
('fish', 'Fish', 10, 0, 1),
('potatos', 'Potatos', 10, 0, 1),
('chickennoodlesoup', 'Chicken Noodle Soup', 10, 0, 1),
('misosoup', 'Miso Soup', 10, 0, 1),
('fries', 'French Fries', 10, 0, 1);
```

{% endhint %}

> **5) JOB ADDING**
>
> The first block shows the data, you'll have to put into shared/jobs.lua in **qbcore**
>
> The second block shows the data, you'll have to put into the database in **esx**

{% hint style="info" %}

```lua
['emerald'] = {
    label = 'The Emerald Bar',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'Helper',
            payment = 30
        },
        ['1'] = {
            name = 'Bartender',
            payment = 40
        },
        ['2'] = {
            name = 'Cook',
            payment = 50
        },
        ['3'] = {
            name = 'Manager',
            payment = 60,
            isboss = true
        },
    },
},
```

{% endhint %}

{% hint style="info" %}

```sql
INSERT INTO `jobs` (name, label) VALUES
('emerald', 'The Emerald Bar');

INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('emerald', 0, 'helper', 'Helper', 30, '{}', '{}'),
('emerald', 1, 'bartender', 'Bartender', 40, '{}', '{}'),
('emerald', 2, 'cook', 'Cook', 60, '{}', '{}'),
('emerald', 3, 'boss', 'Manager', 60, '{}', '{}');
```

{% endhint %}

> **6) CONSUMABLES**
>
> The first 2 blocks i'll show how to add the items into both [qb-smallresources](https://github.com/qbcore-framework/qb-smallresources) and [jim-consumables](https://github.com/jimathy/jim-consumables) for **qbcore**

{% hint style="info" %}
{% code title="qb-smallresources/config.lua" %}

```lua
Config.ConsumablesAlcohol = {
    ["bluelagoon"] = math.random(40, 80),
    ["pinacolada"] = math.random(40, 80),
    ["sanfrancisco"] = math.random(40, 80),
    ["caipirinha"] = math.random(40, 80),
    ["mojito"] = math.random(40, 80),
    ["maitai"] = math.random(40, 80),
}

Config.ConsumablesEat = {
    ["chickennoodlesoup"] = math.random(80, 100),
    ["misosoup"] = math.random(80, 100),
    ["fries"] = math.random(80, 100),
}
```

{% endcode %}
{% endhint %}

{% hint style="info" %}
With jim-consumables, it is a little different, you'll have to find this: **Consumables = {}** in the config file add the following into it.

If you are not able to get it working, ask **jimathy** for help

{% code title="jim-consumables/config.lua" %}

```lua
["bluelagoon"] = {
	emote = "beer", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "alcohol",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(0,0), thirst = math.random(40, 80),
	},
},
["pinacolada"] = {
	emote = "beer", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "alcohol",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(0,0), thirst = math.random(40, 80),
	},
},
["sanfrancisco"] = {
	emote = "beer", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "alcohol",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(0,0), thirst = math.random(40, 80),
	},
},
["caipirinha"] = {
	emote = "beer", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "alcohol",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(0,0), thirst = math.random(40, 80),
	},
},
["mojito"] = {
	emote = "beer", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "alcohol",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(0,0), thirst = math.random(40, 80),
	},
},
["maitai"] = {
	emote = "beer", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "alcohol",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(0,0), thirst = math.random(40, 80),
	},
},


["chickennoodlesoup"] = {
	emote = "eat", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "food",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(80,100), thirst = math.random(0, 0),
	},
},
["misosoup"] = {
	emote = "eat", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "food",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(80,100), thirst = math.random(0, 800,
	},
},
["fries"] = {
	emote = "eat", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "food",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(80,100), thirst = math.random(0, 0),
	},
},
```

{% endcode %}
{% endhint %}
