# Installation guide

{% hint style="danger" %}
If you don't have any experience in development we are highly recommend to follow each step in this documentation, and if you have a developer ask them to install the script for you as they have more experience.
{% endhint %}

***

## Asset download&#x20;

{% hint style="success" %}
Once the purchase is made on our [<mark style="color:blue;">official website</mark>](https://store.brutalscripts.com), you will receive your asset directly in your [<mark style="color:blue;">Keymaster</mark>](https://keymaster.fivem.net), in the Granted Assets panel you will see the asset, download it and do the following steps to install it correctly.
{% endhint %}

* Put the script folder to your server.
* Start the script in the server.cfg. (ensure brutal\_mechanicjob)
* Restart your server! (And you get permission to use the script)

{% hint style="info" %}
[<mark style="color:blue;">**Click here if you haven't installed any script ever**</mark>](https://www.youtube.com/watch?v=55RQrpLhs1w)
{% endhint %}

***

## Upload the items&#x20;

{% hint style="warning" %}
If you don't have the items integrated correctly, you will receive random errors.
{% endhint %}

{% hint style="danger" %}
Check that you don't have duplicate items in your inventory or database before integrating them, otherwise you might have some errors.
{% endhint %}

This asset depends on certain items for its operation, so don't forget to integrate all items correctly into your database or inventory system, depending on how you use your server.

If your inventory is not among the following, you can create the file yourself using the examples of each item by displaying any of the following tabs.

<details>

<summary>Items for esx_inventory</summary>

```sql
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('tool_box', 'Tool Box', 1, 0, 1),
('vehicle_door', 'Vehicle Door', 1, 0, 1),
('vehicle_window', 'Vehicle Window', 1, 0, 1),
('suspension', 'Suspension', 1, 0, 1),
('vehicle_tyre', 'Vehicle Tyre', 1, 0, 1);
```

</details>

<details>

<summary>Items for qb-inventory</summary>

```lua
['tool_box'] 			 		= {['name'] = 'tool_box', 					['label'] = 'Tool Box', 				['weight'] = 10, 		['type'] = 'item', 		['image'] = 'tool_box.png', 			['unique'] = false, 		['useable'] = true, 	['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = 'Not have'},
['vehicle_door'] 			 	= {['name'] = 'vehicle_door', 					['label'] = 'Vehicle Door', 				['weight'] = 10, 		['type'] = 'item', 		['image'] = 'vehicle_door.png', 		['unique'] = false, 		['useable'] = true, 	['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = 'Not have'},
['vehicle_window'] 				= {['name'] = 'vehicle_window', 				['label'] = 'Vehicle Window', 				['weight'] = 10, 		['type'] = 'item', 		['image'] = 'vehicle_window.png', 		['unique'] = false, 		['useable'] = true, 	['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = 'Not have'},
['vehicle_tyre'] 			 	= {['name'] = 'vehicle_tyre', 					['label'] = 'Vehicle Tyre', 				['weight'] = 10, 		['type'] = 'item', 		['image'] = 'vehicle_tyre.png', 		['unique'] = false, 		['useable'] = true, 	['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = 'Not have'},
['suspension'] 			                = {['name'] = 'suspension', 				        ['label'] = 'Suspension', 		                ['weight'] = 10, 		['type'] = 'item', 		['image'] = 'suspension.png',   	        ['unique'] = false, 		['useable'] = true, 	['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = 'Not have'},
```

</details>

<details>

<summary>Items for qs-inventory</summary>

```lua
["tool_box"] = {
    ["name"] = "tool_box",
    ["label"] = "Tool Box",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "tool_box.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Must be important, who knows?"
},

["vehicle_door"] = {
    ["name"] = "vehicle_door",
    ["label"] = "Vehicle Door",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "vehicle_door.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Not have"
},

["vehicle_window"] = {
    ["name"] = "vehicle_window",
    ["label"] = "Vehicle Window",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "vehicle_window.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Not have"
},

["vehicle_tyre"] = {
    ["name"] = "vehicle_tyre",
    ["label"] = "Vehicle Tyre",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "vehicle_tyre.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Not have"
},

["suspension"] = {
    ["name"] = "suspension",
    ["label"] = "Suspension",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "suspension.png",
    ["unique"] = false,
    ["useable"] = true,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "What the heck is this?"
},
```

</details>

<details>

<summary>Items for ox_inventory</summary>

```lua
["tool_box"] = {
    label = "Tool Box",
    weight = 1,
    stack = true,
    close = false,
},

["vehicle_door"] = {
    label = "Vehicle Door",
    weight = 1,
    stack = true,
    close = false,
},

["vehicle_window"] = {
    label = "Vehicle Window",
    weight = 1,
    stack = true,
    close = false,
},

["vehicle_tyre"] = {
    label = "Vehicle Tyre",
    weight = 1,
    stack = true,
    close = false,
},

["suspension"] = {
    label = "Suspension",
    weight = 1,
    stack = true,
    close = false,
},
```

</details>

{% hint style="info" %}
[<mark style="color:blue;">**Click here if you don't know how to upload the sql, here is a quick guide**</mark>](https://www.youtube.com/watch?v=NXqmYn7bbMM)
{% endhint %}

Here you can find the images which we used for the items

{% file src="<https://4039149930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7v0UUR2mr3gc8OlYzKhO%2Fuploads%2FIUxguMbFOfyQl0DqD4le%2FItems.zip?alt=media&token=2024df61-76de-4ff1-87b5-cc261e70735a>" %}
Item images
{% endfile %}

***

## Asset positioning

{% hint style="danger" %}
Correctly position the assets in the server.cfg by following this step, if something goes wrong you will probably get errors about exports not found, do not skip this step!
{% endhint %}

```lua
-- First we will start the cores, never below
ensure es_extended or qb-core

-- The Notify / TextUI / Progressbar / Inventory / Billing have to be above our asset
ensure [notify]
ensure [textui]
ensure [progressbar]
ensure [inventory]
ensure [billing]

-- Start the Brutal Crafting at the end
ensure brutal_mechanicjob
```

***

## Setting up the Webhook&#x20;

If you want to use the opportunnities which can be given by a webhook then you will have to set it up in our assets. You can do it by changeing a value to your [<mark style="color:blue;">discord webhook</mark>](https://docs.brutalscripts.com/site/others/discord-webhook) in the sv-utils.lua file.

<figure><img src="https://4039149930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7v0UUR2mr3gc8OlYzKhO%2Fuploads%2FYD3dBIsrNLZ1Jvx3Sm8L%2FK%C3%A9perny%C5%91k%C3%A9p%202024-02-16%20213349.png?alt=media&#x26;token=fa6bcf52-a448-4a88-acfe-f12faacb75a3" alt=""><figcaption><p>sv-utils.lua</p></figcaption></figure>

{% content-ref url="../../others/discord-webhook" %}
[discord-webhook](https://docs.brutalscripts.com/site/others/discord-webhook)
{% endcontent-ref %}

***

## Setting the loaded event

{% hint style="danger" %}
If you are using a multicharacter system then this step is really important to make our script working propetly! If you don't use any or the loaded event is the same as the basic core one then you are done with this step.
{% endhint %}

In the client-core.lua file go to the LoadedEvent variable and if you are using a different event then paste there your event which is used on your server.

<figure><img src="https://4039149930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7v0UUR2mr3gc8OlYzKhO%2Fuploads%2FiZsIrf5OSm3hfTPFbEiS%2FK%C3%A9perny%C5%91k%C3%A9p%202024-03-03%20210541.png?alt=media&#x26;token=c320d17a-ed65-4f76-8933-67914ef7b8c9" alt=""><figcaption><p>client-core.lua</p></figcaption></figure>

***

## Editing framework

{% hint style="danger" %}
You have to make some modifications on your framework to to use this asset. Do not skip these steps as it will cause that the script will not work propetly!
{% endhint %}

### <mark style="color:blue;">ESX</mark>

<mark style="color:blue;">Navigate to esx\_society/server/main.lua and replace this function:</mark>

```lua
function isPlayerBoss(playerId, job)
	local xPlayer = ESX.GetPlayerFromId(playerId)

	if xPlayer.job.name == job then
		return true
	else
		print(('esx_society: %s attempted open a society boss menu!'):format(xPlayer.identifier))
		return false
	end
end
```

<mark style="color:blue;">If you want the players only get paycheck if they are on duty then replace this file:</mark>\ <mark style="color:blue;">**es\_extended/server /paycheck.lua**</mark>

{% file src="<https://4039149930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7v0UUR2mr3gc8OlYzKhO%2Fuploads%2FvD4GlLbC0DIU9sxVxIOo%2Fpaycheck.lua?alt=media&token=659bd54e-c835-486f-8ad7-01f009641b10>" %}

### <mark style="color:orange;">QBCORE</mark>

<mark style="color:orange;">Navigate to</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**qb-core/shared/job.lua**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">and set the</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**defaultDuty to false**</mark><mark style="color:orange;">:</mark>

<figure><img src="https://4039149930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7v0UUR2mr3gc8OlYzKhO%2Fuploads%2Fq1e6ApI3eBhkAacDiob7%2Fimage.png?alt=media&#x26;token=6edfb9fb-5e3d-46d5-8c65-d4dd52ec48f7" alt=""><figcaption><p><strong>qb-core/shared/job.lua</strong></p></figcaption></figure>

***

## Installing the props

{% hint style="danger" %}
To use the vehicle lift functionality in the script you have to add props to your server. If you miss this step you will get random errors!
{% endhint %}

Download the attached file and then you have to start this assets just like any other script on your server.

{% file src="<https://4039149930-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7v0UUR2mr3gc8OlYzKhO%2Fuploads%2F35rE6rVfCSoRNodaMxP4%2Fvehiclelift_props.zip?alt=media&token=82d9060c-a4e7-4ebc-ad02-ebc48a03f0c6>" %}

***

## Checking the Config file

Please make sure that you go through the whole file during the installation and check everything. It is one of the most important things as if you miss this step the script might won't work propetly.

### Most important steps

The most important things always at the top of the config so pay the most attencion to these elements.

<details>

<summary>Setting the Core</summary>

Set your server's core wether it's using es\_extended or qb-core, other cores aren't supported .

</details>

<details>

<summary>Setting the Notify</summary>

If you are using the [<mark style="color:blue;">Brutal Notify</mark>](https://docs.brutalscripts.com/site/scripts/notify) then it is good news, you don't have to do anything.\
If you aren't then set the BrutalNotify value to false in the config and set up your own notify in the cl-utils.lua

</details>

<details>

<summary>Setting the TextUI</summary>

Set the TextUI from the options which are commented out. If your server using an other TextUI  it is not a problem, you can set it up in the cl-utils.lua.

</details>

***

{% hint style="danger" %}

## Remove the basic Mechanic Job from your server

If you have the **esx\_mechanicjob**, **qb-mechanicjob**, or any other similar basic job like these, you don't need them anymore, so you can easily remove them from your server files!
{% endhint %}

## If you got any error

If you followed the installation guide and the script still don't work or you get any errors the please check the common errors, here in the docs and in our [discord](https://discord.com/invite/85u2u5c8q9) server, for more informations.
