# okokMechanicJob

[**YouTube Video**](https://www.youtube.com/watch?v=ij8YKjNB-Fw)

## Installation Guide

### Requirements:

ox\_lib **v3.16.2+** (<https://github.com/overextended/ox_lib/releases/latest/download/ox_lib.zip>).

### Execute the following SQL code in your database:

{% tabs %}
{% tab title="ESX" %}

```sql
ALTER TABLE `owned_vehicles` ADD `vehiclemileage` INT(11) NOT NULL DEFAULT '0';
ALTER TABLE `owned_vehicles` ADD `vehiclestatus` LONGTEXT DEFAULT '{"oil":0,"brakes":0,"filters":0,"battery":0, "timingbelt":0, "enginefluid":0, "tires":0, "lights":0}';
ALTER TABLE `owned_vehicles` ADD `vehiclenitrouslevel` LONGTEXT DEFAULT '{"nitrouslevel":0,"nitroustype":"none"}';
ALTER TABLE `owned_vehicles` ADD `vehiclestance` LONGTEXT DEFAULT NULL;
ALTER TABLE `owned_vehicles` ADD `vehicleengine` LONGTEXT DEFAULT '{"engine":"stock","defaultspeed":0}';
ALTER TABLE `owned_vehicles` ADD `vehicletuning` LONGTEXT DEFAULT '{"defaultboost":0, "boost":0, "defaultacceleration":0, "acceleration":0, "defaultgear":0,"gear":0, "defaultdrivetrain":0, "drivetrain":"0","defaultbrake":0, "brake":0, "smoke":false, "pops":false, "driftmode":false}';

INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('oil', 'Oil', 0, 0, 1), ('brakes', 'Brakes', 0, 0, 1), ('filters', 'Filters', 0, 0, 1), ('battery', 'Battery', 0, 0, 1), ('engine', 'Engine', 250, 0, 1), ('timingbelt', 'Timing Belt', 0, 0, 1), ('enginefluid', 'Engine Fluid', 0, 0, 1), ('tire', 'Tire', 0, 0, 1), ('cleaningkit', 'Cleaning Kit', 250, 0, 1), ('dynoprintout', 'Dyno Printout', 250, 0, 1), ('lights', 'Lights', 250, 0, 1), ('nitrousrecharge', 'Nitrous Recharge', 250, 0, 1);
```

{% endtab %}

{% tab title="QBCore" %}

```sql
ALTER TABLE `player_vehicles` ADD `vehiclemileage` INT(11) NOT NULL DEFAULT '0';
ALTER TABLE `player_vehicles` ADD `vehiclestatus` LONGTEXT DEFAULT '{"oil":0,"brakes":0,"filters":0,"battery":0, "timingbelt":0, "enginefluid":0, "tires":0, "lights":0}';
ALTER TABLE `player_vehicles` ADD `vehiclenitrouslevel` LONGTEXT DEFAULT '{"nitrouslevel":0,"nitroustype":"none"}';
ALTER TABLE `player_vehicles` ADD `vehiclestance` LONGTEXT DEFAULT NULL;
ALTER TABLE `player_vehicles` ADD `vehicleengine` LONGTEXT DEFAULT '{"engine":"stock","defaultspeed":0}';
ALTER TABLE `player_vehicles` ADD `vehicletuning` LONGTEXT DEFAULT '{"defaultboost":0, "boost":0, "defaultacceleration":0, "acceleration":0, "defaultgear":0,"gear":0, "defaultdrivetrain":0, "drivetrain":"0","defaultbrake":0, "brake":0, "smoke":false, "pops":false, "driftmode":false}';
```

{% endtab %}
{% endtabs %}

### Update setVehicleProperties function

#### ESX

Navigate to **es\_extended/client/functions.lua** and add the following code inside the `setVehicleProperties` function:

```lua
exports['okokMechanicJob']:setVehicleProperties(vehicle)
```

#### QBCore

Navigate to **qb-core/client/functions.lua** and add the following code inside the `setVehicleProperties` function:

```lua
exports['okokMechanicJob']:setVehicleProperties(vehicle)
```

### QBCORE ONLY

Add Item:

```lua
oil = { name = 'oil', label = 'Oil', weight = 0, type = 'item', image = 'oil.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
brakes = { name = 'brakes', label = 'Brakes', weight = 0, type = 'item', image = 'brakes.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
filters = { name = 'filters', label = 'Filters', weight = 0, type = 'item', image = 'filters.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
battery = { name = 'battery', label = 'Battery', weight = 0, type = 'item', image = 'battery.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
engine = { name = 'engine', label = 'Engine', weight = 250, type = 'item', image = 'engine.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Engine to replace on your vehicle' },
timingbelt = { name = 'timingbelt', label = 'Timing Belt', weight = 0, type = 'item', image = 'timingbelt.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
enginefluid = { name = 'enginefluid', label = 'Engine Fluid', weight = 0, type = 'item', image = 'enginefluid.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
tire = { name = 'tire', label = 'Tire', weight = 0, type = 'item', image = 'tire.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = '' },
cleaningkit = { name = 'cleaningkit', label = 'Cleaning Kit', weight = 250, type = 'item', image = 'cleaningkit.png', unique = false, useable = true, shouldClose = true, combinable = nil, description = 'A microfiber cloth with some soap will let your car sparkle again!' },
dynoprintout = { name = 'dynoprintout', label = 'Dyno Printout', weight = 250, type = 'item', image = 'dynoprintout.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'A dyno comprovative of your vehicle performance' },
lights = { name = 'lights', label = 'Lights', weight = 250, type = 'item', image = 'lights.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Lights to replace on your vehicle' },
nitrousrecharge = { name = 'nitrousrecharge', label = 'Nitrous Recharge', weight = 250, type = 'item', image = 'nitrousrecharge.png', unique = true, useable = true, shouldClose = true, combinable = nil, description = 'Recharge for your nitrous bottle' },
```

### OX Inventory Items

```lua
["oil"] = {label = "Oil", weight = 120, stack = true, close = true},
["brakes"] = {label = "brakes", weight = 120, stack = true, close = true},
["filters"] = {label = "Filter", weight = 120, stack = true, close = true},
["battery"] = {label = "Battery", weight = 120, stack = true, close = true},
["timingbelt"] = {label = "Timing belt", weight = 120, stack = true, close = true},
["enginefluid"] = {label = "Engine fluid", weight = 120, stack = true, close = true},
["tire"] = {label = "Tire", weight = 120, stack = true, close = true},
["cleaningkit"] = {label = "Cleaning kit", weight = 120, stack = true, close = true},
["repairkit"] = {label = "Repair kit", weight = 120, stack = true, close = true},
["advancedrepairkit"] = {label = "Advanced repair kit", weight = 120, stack = true, close = true},
["nitrous"] = {label = "Nitrous", weight = 120, stack = true, close = true},
["nitrousrecharge"] = {label = "Nitrous Recharge", weight = 120, stack = true, close = true},
["engine"] = {label = "Engine", weight = 120, stack = true, close = true},
["lights"] = {label = "Lights", weight = 120, stack = true, close = true},
["dynoprintout"] = {label = "Dyno Printout", weight = 120, stack = false, close = true},
```

### Flatbed

{% embed url="<https://github.com/flowdgodx/flatbed>" %}

### Recommended Sound Pack

{% embed url="<https://github.com/SpiritsCreations/FiveM-Engine-Sound-Pack>" %}
