# Script Install

**Dependencies**

* One Sync Infinity
* [\[ox\_lib\]](https://github.com/overextended/ox_lib/releases)
* [\[oxmysql\]](https://github.com/overextended/oxmysql/releases)
* Targeting Resource
  * [\[qb-target\]](https://github.com/qbcore-framework/qb-target/releases)
  * [\[ox\_target\]](https://github.com/overextended/ox_target/releases)
  * Setup custom inside \[mk\_utils] `cl_target.lua`
* \[mk\_utils] (Provided with script)

**Install Steps**

* Install Dependencies
* Download \[mk\_utils] from Keymaster (access provided with script purchase)
  * ![](https://51694285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSadY5GIZVZCGCeog04Gq%2Fuploads%2FU5gkLPTZnoumv95rS1Tj%2Fmk_utils_download.png?alt=media\&token=099d5518-04ee-48a1-ad6a-ac37a56b9d4a)
* add `mk_utils` to resource folder
* add `mk_vehicleshop` to resource folder
* add `ensure mk_utils` into server.cfg (It must be added **BEFORE** mk\_vehicleshop)
* add `ensure mk_vehicleshop`into server.cfg
* Make sure `ox_lib` ace permissions are in `server.cfg`&#x20;

```
add_ace resource.ox_lib command.add_ace allow
add_ace resource.ox_lib command.remove_ace allow
add_ace resource.ox_lib command.add_principal allow
add_ace resource.ox_lib command.remove_principal allow
```

Your server.cfg should look similar to this when finished

<div align="left"><figure><img src="https://51694285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSadY5GIZVZCGCeog04Gq%2Fuploads%2F0iJXolKI17X0HMelJPHy%2Fshop.png?alt=media&#x26;token=32a22bc7-7a61-4616-8f07-c8e8e11c7391" alt="" width="323"><figcaption></figcaption></figure></div>

* Run `mk_vehicleshop.sql` or the following query into your database

<pre class="language-sql"><code class="lang-sql"><strong>CREATE TABLE `mk_vehicleshops` (
</strong>	`name` VARCHAR(50) NOT NULL COLLATE 'utf8_general_ci',
	`showroom` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8_general_ci',
	`stock` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8_general_ci',
	`restockQuery` LONGTEXT NULL DEFAULT NULL COLLATE 'utf16_general_ci',
	PRIMARY KEY (`name`) USING BTREE
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
</code></pre>

* Make the following edits based upon your used framework

{% tabs %}
{% tab title="qb-core" %}
Run `qb.sql` or the following query into your database

```sql
ALTER TABLE `player_vehicles` ADD COLUMN IF NOT EXISTS `vehicleData` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8_general_ci';

```

If you are using the Luxury PDM provided with default qb-core Navigate to `mk_vehicleshop/config/locations.lua` and uncomment lines `269` through `395` to enable this shop

Navigate to `qb-smallresources/config.lua` and insert the following code to the end of this file:

```lua
function getBlacklistedVehs()
    return Config.BlacklistedVehs
end
exports('GetBlacklistedVehicles', getBlacklistedVehs)
```

Adding this will disallow any blacklisted vehicles from being put into any of the shops.
{% endtab %}

{% tab title="qbx" %}
Run `qb.sql` or the following query into your database

```sql
ALTER TABLE `player_vehicles` ADD COLUMN IF NOT EXISTS `vehicleData` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8_general_ci';

```

{% endtab %}

{% tab title="esx" %}
Run `esx.sql` or the following query into your database

```sql
ALTER TABLE `owned_vehicles` ADD COLUMN IF NOT EXISTS `vehicleData` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8_general_ci';

INSERT INTO `vehicles` (`name`, `model`, `price`, `category`) VALUES
    ('Longfin', 'longfin', 40000, 'boats'),
    ('Toro', 'toro', 40000, 'boats'),
    ('Toro Yacht', 'toro2', 40000, 'boats'),
    ('Speeder', 'speeder', 40000, 'boats'),
    ('Speeder Yacht', 'speeder2', 40000, 'boats'),
    ('Tropic', 'tropic', 40000, 'boats'),
    ('Tropic Yacht', 'tropic2', 40000, 'boats'),
    ('Suntrap', 'suntrap', 40000, 'boats'),
    ('Squalo', 'squalo', 40000, 'boats'),
    ('Seashark', 'seashark', 40000, 'boats'),
    ('Seashark Yacht', 'seashark3', 40000, 'boats'),
    ('Marquis', 'marquis', 40000, 'boats'),
    ('Jetmax', 'jetmax', 40000, 'boats'),
    ('Dinghy 2-Seater', 'dinghy', 40000, 'boats'),
    ('Dinghy 4-Seater', 'dinghy2', 40000, 'boats'),
    ('Dinghy (Heist)', 'dinghy3', 40000, 'boats'),
    ('Dinghy Yacht', 'dinghy4', 40000, 'boats');

INSERT INTO `vehicle_categories` (`name`, `label`) VALUES
    ('boats', 'Boats');
    
```

{% endtab %}
{% endtabs %}

* Default GTA vehicle images are pulled off github for the vehicle shop menu. If you have custom vehicles you want to add images for they need to be added to `mk_utils/vehicleimages` in `.png` format. If you store your vehicle images in another script you can edit the image path inside `mk_vehicleshop/config/config.lua` under the `GetVehicleImageLink` function
