# Installation

## 📥 Installation

### Requirements

* **FiveM Server** (latest recommended)
* **oxmysql** (required)
* **Framework:** ESX or QBCore (optional, works standalone)
* **Target:** ox\_target or qb-target (optional, drawtext fallback)

***

### Step 1: Download & Extract

1. Download the resource from Tebex
2. Extract `elenachop` folder to your server's `resources` directory
3. resources/   \
   └── \[elenachop]/   \
   ├── client/   \
   ├── server/   \
   ├── shared/   \
   ├── ui/   \
   ├── fxmanifest.lua   \
   └── chop\_shop.sql

***

### Step 2: Import Database

Import the `chop_shop.sql` file into your database:

```sql
CREATE TABLE IF NOT EXISTS `chop_shop_players` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `identifier` VARCHAR(100) NOT NULL UNIQUE,
    `reputation` INT DEFAULT 0,
    `total_chops` INT DEFAULT 0,
    `total_earnings` BIGINT DEFAULT 0,
    `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `chop_shop_logs` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `identifier` VARCHAR(100) NOT NULL,
    `part_id` VARCHAR(50) NOT NULL,
    `vehicle_plate` VARCHAR(20),
    `price` INT DEFAULT 0,
    `items_given` VARCHAR(100),
    `timestamp` INT NOT NULL,
    `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    INDEX `idx_identifier` (`identifier`),
    INDEX `idx_timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `chop_shop_economy` (
    `part_id` VARCHAR(50) PRIMARY KEY,
    `multiplier` FLOAT DEFAULT 1.0,
    `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
```

### Step 3: Add Items

You **must** add the following items to your inventory system.

#### ox\_inventory

Add to `ox_inventory/data/items.lua`:

```
['chop_engine'] = {
    label = 'Engine',
    weight = 5000,
    stack = true,
},
['vehicle_transmission'] = {
    label = 'Transmission',
    weight = 4000,
    stack = true,
},
['chop_wheel'] = {
    label = 'Wheel & Tire',
    weight = 3000,
    stack = true,
},
['vehicle_electronics'] = {
    label = 'Electronics',
    weight = 1500,
    stack = true,
},
['chop_door'] = {
    label = 'Car Door',
    weight = 3500,
    stack = true,
},
['chop_hood'] = {
    label = 'Hood',
    weight = 3000,
    stack = true,
},
['chop_trunk'] = {
    label = 'Trunk Lid',
    weight = 2500,
    stack = true,
},
['vehicle_exhaust'] = {
    label = 'Exhaust System',
    weight = 2000,
    stack = true,
},
```

#### QBCore

Add to `qb-core/shared/items.lua`:

```
chop_engine          = { name = 'chop_engine',          label = 'Engine',        weight = 5000, type = 'item', image = 'chop_engine.png',          unique = false, useable = false, shouldClose = false, description = 'Chopped engine part' },
vehicle_transmission = { name = 'vehicle_transmission', label = 'Transmission',  weight = 4000, type = 'item', image = 'vehicle_transmission.png', unique = false, useable = false, shouldClose = false, description = 'Chopped transmission' },
chop_wheel           = { name = 'chop_wheel',           label = 'Wheel & Tire',  weight = 3000, type = 'item', image = 'chop_wheel.png',           unique = false, useable = false, shouldClose = false, description = 'Chopped wheel and tire' },
vehicle_electronics  = { name = 'vehicle_electronics',  label = 'Electronics',   weight = 1500, type = 'item', image = 'vehicle_electronics.png',  unique = false, useable = false, shouldClose = false, description = 'Chopped electronics' },
chop_door            = { name = 'chop_door',            label = 'Car Door',      weight = 3500, type = 'item', image = 'chop_door.png',            unique = false, useable = false, shouldClose = false, description = 'Chopped car door' },
chop_hood            = { name = 'chop_hood',            label = 'Hood',          weight = 3000, type = 'item', image = 'chop_hood.png',            unique = false, useable = false, shouldClose = false, description = 'Chopped hood' },
chop_trunk           = { name = 'chop_trunk',           label = 'Trunk Lid',     weight = 2500, type = 'item', image = 'chop_trunk.png',           unique = false, useable = false, shouldClose = false, description = 'Chopped trunk lid' },
vehicle_exhaust      = { name = 'vehicle_exhaust',      label = 'Exhaust',       weight = 2000, type = 'item', image = 'vehicle_exhaust.png',      unique = false, useable = false, shouldClose = false, description = 'Chopped exhaust system' },
```

#### ESX

Items are automatically registered. No manual steps needed.


---

# 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://elena-scripts.gitbook.io/elenascripts/jobs-and-activities/chop-shop-v1/installation.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.
