> For the complete documentation index, see [llms.txt](https://docs.apx-studios.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apx-studios.com/docs/resources/businesses/restaurants/apex-pizza-this/installation.md).

# 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></tbody></table>

> **OPTIONAL DEPENDENCIES**

| Resource | Download                                                                      |
| -------- | ----------------------------------------------------------------------------- |
| Mapping  | [Gabz](https://fivem.gabzv.com/package/4724795) Recommend / Whatever you want |

### 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_pizzathis
```

{% endhint %}

> **3) ASSET ADDING**

{% hint style="info" %}

1. Open apex\_pizzathis > 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
--[FOOD INGREDIENTS]--
['cheese'] 		= {['name'] = 'cheese', 	['label'] = 'Cheese Slices', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'cheese.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['mozzarella'] 		= {['name'] = 'mozzarella', 	['label'] = 'Mozzarella', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'mozzarella.png',       ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['lettuce'] 		= {['name'] = 'lettuce', 	['label'] = 'Lettuce', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'lettuce.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['mushrooms'] 		= {['name'] = 'mushrooms', 	['label'] = 'Mushrooms', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'mushrooms.png',        ['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['ham'] 		= {['name'] = 'ham', 		['label'] = 'Ham', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'ham.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['meat'] 		= {['name'] = 'meat', 		['label'] = 'Meat', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'meat.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['pepperoni'] 		= {['name'] = 'pepperoni', 	['label'] = 'Pepperoni', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'pepperoni.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['seafoodmix'] 		= {['name'] = 'seafoodmix', 	['label'] = 'Seafood Mix', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'seafoodmix.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['tomato'] 		= {['name'] = 'tomato', 	['label'] = 'Tomatos', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'tomato.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['tomatosauce'] 	= {['name'] = 'tomatosauce', 	['label'] = 'Tomato Sauce', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'tomatosauce.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['oil'] 		= {['name'] = 'oil', 		['label'] = 'Oil', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'oil.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['flour'] 		= {['name'] = 'flour', 		['label'] = 'Flour', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'flour.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'},
['salt'] 		= {['name'] = 'salt', 		['label'] = 'Salt', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'salt.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['dough'] 		= {['name'] = 'dough', 		['label'] = 'Dough', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'dough.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Ingredients'},
['pizzabase'] 		= {['name'] = 'pizzabase', 	['label'] = 'Pizza Base', 		['weight'] = 100,['type'] = 'item', ['image'] = 'pizzabase.png', 	['unique'] = true,  ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Buttom of a pizza'},
['durumbase'] 		= {['name'] = 'durumbase', 	['label'] = 'Durum Base', 		['weight'] = 100,['type'] = 'item', ['image'] = 'durumbase.png', 	['unique'] = true,  ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Wrap for a durum'},
--[FOOD]--
['veganpizza'] 		= {['name'] = 'veganpizza', 	['label'] = 'Vegan Pizza', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'veganpizza.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Food'},
['margharita'] 		= {['name'] = 'margharita', 	['label'] = 'Margharita Pizza', 	['weight'] = 10, ['type'] = 'item', ['image'] = 'margharita.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Food'},
['napollitano'] 	= {['name'] = 'napollitano', 	['label'] = 'Napollitano Pizza', 	['weight'] = 10, ['type'] = 'item', ['image'] = 'napollitano.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Food'},
['mushroompizza'] 	= {['name'] = 'mushroompizza', 	['label'] = 'Mushroom Pizza', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'mushroompizza.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Food'},
['oceanpizza'] 		= {['name'] = 'oceanpizza', 	['label'] = 'Ocean Pizza', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'oceanpizza.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Food'},
['deeppan'] 		= {['name'] = 'deeppan', 	['label'] = 'Deep Pan Pizza', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'deeppan.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Food'},
['durum'] 		= {['name'] = 'durum', 		['label'] = 'Durum', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'durum.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Food'},
--[DRINKS]--
['milkshake'] 		= {['name'] = 'milkshake', 	['label'] = 'Milkshake', 		['weight'] = 10, ['type'] = 'item', ['image'] = 'milkshake.png', 	['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Drink'},
['soda'] 		= {['name'] = 'soda', 		['label'] = 'Soda', 			['weight'] = 10, ['type'] = 'item', ['image'] = 'soda.png', 		['unique'] = false, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil,   ['description'] = 'Drink'},
```

{% endhint %}

{% hint style="info" %}

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('cheese', 'Cheese Slices', 10, 0, 1),
('mozzarella', 'Mozzarella', 10, 0, 1),
('lettuce', 'Lettuce', 10, 0, 1),
('mushrooms', 'Mushrooms', 10, 0, 1),
('ham', 'Ham', 10, 0, 1),
('meat', 'Meat', 10, 0, 1),
('pepperoni', 'Pepperoni', 10, 0, 1),
('seafoodmix', 'Seafood Mix', 10, 0, 1),
('tomato', 'Tomatos', 10, 0, 1),
('tomatosauce', 'Tomato Sauce', 10, 0, 1),
('oil', 'Oil', 10, 0, 1),
('flour', 'Flour', 10, 0, 1),
('sugar', 'Sugar', 10, 0, 1),
('salt', 'Salt', 10, 0, 1),
('dough', 'Dough', 10, 0, 1),
('pizzabase', 'Pizza Base', 10, 0, 1),
('durumbase', 'Durum Base', 10, 0, 1),
('veganpizza', 'Vegan Pizza', 10, 0, 1),
('margharita', 'Margharita Pizza', 10, 0, 1),
('napollitano', 'Napollitano Pizza', 10, 0, 1),
('mushroompizza', 'Mushroom Pizza', 10, 0, 1),
('oceanpizza', 'Ocean Pizza', 10, 0, 1),
('deeppan', 'Deep Pan Pizza', 10, 0, 1),
('durum', 'Durum', 10, 0, 1),
('milkshake', 'Milkshake', 10, 0, 1),
('soda', 'Soda', 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
['pizzathis'] = {
    label = 'Pizza This',
    defaultDuty = true,
    offDutyPay = false,
    grades = {
        ['0'] = {
            name = 'Helper',
            payment = 30
        },
        ['1'] = {
            name = 'Delivery',
            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
('pizzathis', 'Pizza This');

INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('pizzathis', 0, 'helper', 'Helper', 30, '{}', '{}'),
('pizzathis', 1, 'delivery', 'Delivery', 40, '{}', '{}'),
('pizzathis', 2, 'cook', 'Cook', 60, '{}', '{}'),
('pizzathis', 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.ConsumablesDrink = {
    ["milkshake"] = math.random(40, 80),
    ["soda"] = math.random(40, 80),
}

Config.ConsumablesEat = {
    ["veganpizza"] = math.random(80, 100),
    ["margharita"] = math.random(80, 100),
    ["napollitano"] = math.random(80, 100),
    ["mushroompizza"] = math.random(80, 100),
    ["oceanpizza"] = math.random(80, 100),
    ["deeppan"] = math.random(80, 100),
    ["durum"] = 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
["milkshake"] = {
	emote = "drink", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "drink",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(0,0), thirst = math.random(40, 80),
	},
},
["soda"] = {
	emote = "drink", time = math.random(5000, 6000), stress = math.random(1, 2), heal = 0, armor = 5, type = "drink",
	stats = {
		screen = "", effect = "heal", time = 10000, amount = 2,
		hunger = math.random(0,0), thirst = math.random(40, 80),
	},
},

["veganpizza"] = {
	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),
	},
},
["margharita"] = {
	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),
	},
},
["napollitano"] = {
	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),
	},
},
["mushroompizza"] = {
	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),
	},
},
["oceanpizza"] = {
	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),
	},
},
["deeppan"] = {
	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),
	},
},
["durum"] = {
	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 %}
