# Installations

## Step 1 ➡ Dependencies&#x20;

This is one of the most important parts, since without the dependencies, the resource will never work or not start, here we will list the dependencies with their respective links for you to download and add them to your server.

{% embed url="<https://github.com/overextended/oxmysql>" %}

{% embed url="<https://github.com/overextended/ox_inventory>" %}
Recommended but not required, you can configure the script for your own resources
{% endembed %}

## Step 2 ➡ Resources in server.cfg

{% hint style="warning" %}
if you are using ESX ➡ NEVER, but NEVER, you must place the resources above `es_extended`, if you do this they will never work and will throw errors
{% endhint %}

The correct order of the resources is as follows, always keeping <mark style="color:orange;">es\_extended</mark> and its cores above, but the other normal resources below

```
ensure sfvehicleshop
```

## Step 3 ➡ Database

Run query/SQL query and paste below code

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

```sql
ALTER TABLE `vehicles` ADD `class` VARCHAR(2) NULL DEFAULT NULL AFTER `category`, ADD `shop` VARCHAR(16) NOT NULL DEFAULT 'vehicle' AFTER `class`, ADD `display` INT(2) NOT NULL DEFAULT '1' AFTER `shop`, ADD `limitSold` INT(11) NOT NULL DEFAULT '0' AFTER `display`, ADD `sold` INT(11) NOT NULL DEFAULT '0' AFTER `limitSold`;

CREATE TABLE `vehicle_classes` (
  `name` varchar(60) NOT NULL,
  `label` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `vehicle_classes` ADD PRIMARY KEY (`name`);

INSERT INTO `vehicle_classes` (`name`, `label`) VALUES
('A', 'Class A'),
('B', 'Class B'),
('C', 'Class C'),
('D', 'Class D'),
('E', 'Class E'),
('F', 'Class F'),
('S', 'Class S'),
('S+', 'Class S+');
```

{% endtab %}

{% tab title="QBCore" %}
{% code fullWidth="false" %}

```sql
CREATE TABLE `vehicle_categories` (
  `name` varchar(60) NOT NULL,
  `label` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `vehicle_categories` ADD PRIMARY KEY (`name`);

CREATE TABLE `vehicle_classes` (
  `name` varchar(60) NOT NULL,
  `label` varchar(60) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `vehicle_classes` ADD PRIMARY KEY (`name`);

CREATE TABLE `vehicles` (
  `id` int(11) NOT NULL,
  `name` varchar(60) NOT NULL,
  `model` varchar(60) NOT NULL,
  `price` int(11) NOT NULL,
  `category` varchar(60) DEFAULT NULL,
  `class` varchar(2) DEFAULT NULL,
  `shop` varchar(16) NOT NULL DEFAULT 'vehicle',
  `display` int(2) NOT NULL DEFAULT 1,
  `limitSold` int(11) NOT NULL DEFAULT 0,
  `sold` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
ALTER TABLE `vehicles` ADD PRIMARY KEY (`id`);
ALTER TABLE `vehicles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;

INSERT INTO `vehicle_categories` (`name`, `label`) VALUES
('compacts', 'Compacts'),
('coupes', 'Coupés'),
('motorcycles', 'Motos'),
('muscle', 'Muscle'),
('offroad', 'Off Road'),
('sedans', 'Sedans'),
('sports', 'Sports'),
('sportsclassics', 'Sports Classics'),
('super', 'Super'),
('suvs', 'SUVs'),
('vans', 'Vans');

INSERT INTO `vehicle_classes` (`name`, `label`) VALUES
('A', 'Class A'),
('B', 'Class B'),
('C', 'Class C'),
('D', 'Class D'),
('E', 'Class E'),
('F', 'Class F'),
('S', 'Class S'),
('S+', 'Class S+');
```

{% endcode %}

Example data:

```sql
INSERT INTO `vehicles` (`name`, `model`, `price`, `category`, `class`, `shop`, `display`, `limitSold`, `sold`) VALUES
('Adder', 'adder', 90000, 'super', 'A', 'vehicle', 1, 2, 2),
('Akuma', 'AKUMA', 7500, 'motorcycles', NULL, 'vehicle', 1, 1, 1),
('Alpha', 'alpha', 60000, 'sports', NULL, 'vehicle', 1, 0, 0),
('Speeder', 'speeder', 220000, 'boat', '', 'boat', 1, 0, 0),
('Tug', 'tug', 210000, 'boat', '', 'boat', 1, 0, 0),
('Nimbus', 'nimbus', 1000000, 'plane', '', 'plane', 1, 0, 0),
('Miljet', 'miljet', 2000000, 'plane', '', 'plane', 1, 0, 0),
('Luxor', 'luxor', 3000000, 'plane', '', 'plane', 1, 0, 0),
('SuperVolito', 'supervolito', 1000000, 'plane', '', 'plane', 1, 0, 0),
('Police', 'police', 10000, 'police', 'B', 'vehiclePolice', 1, 0, 1);
```

{% endtab %}
{% endtabs %}

## Step 4 ➡ Click on [Config](/resources/sfvehicleshop/config.md)&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scriptsfivem.com/resources/sfvehicleshop/installations.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
