# Installation & Configuration

## ⚒️ Car Crafting 2.0

Qubit's Car Crafting 2.0 brings a fully standalone in-game management panel, animated vehicle crafting, job-restricted zones, and database-driven configuration all without touching a single config file after initial setup.

**Extra Support:** [Discord](https://discord.gg/M4ms6RyxMW)

***

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FBmeUECvBbpr3uY3xWuO4%2Fv2.jpg?alt=media&#x26;token=b50ac598-d095-44b8-99bf-a67b0e01402f" alt=""><figcaption></figcaption></figure>

### &#x20;What's New in 2.0

| Feature                    | Description                                                 |
| -------------------------- | ----------------------------------------------------------- |
| **Standalone Manager UI**  | Full in-game management panel no config editing needed      |
| **Database-Driven Config** | All vehicles, items, areas, and types stored in MySQL       |
| **Vehicle Types**          | Group vehicles by type (Sedan, Helicopter, Boat, etc.)      |
| **Animated Crafting**      | Per-part installation with animations, sounds & particles   |
| **Job-Based Zones**        | Restrict craft areas to specific jobs or open to everyone   |
| **Multiple Locations**     | Add unlimited locations per craft area anywhere on the map  |
| **Craft Chance System**    | Set success percentage per vehicle                          |
| **Cinematic Camera**       | Dynamic camera angles based on vehicle class                |
| **Multi-Language**         | Built-in English, Turkish, German, French support           |
| **Live Reload**            | Initialize button reloads all config without server restart |

***

## Installation & Configuration

### Dependencies

Install the following resources before starting `qubit-carcrafting`:

| Dependency     | Required | Download                                                       |
| -------------- | -------- | -------------------------------------------------------------- |
| **oxmysql**    | ✅        | Included with most frameworks                                  |
| **ox\_lib**    | ✅        | [Download](https://github.com/overextended/ox_lib/releases)    |
| **xsound**     | ✅        | [Download](https://github.com/Xogy/xsound/releases)            |
| **ox\_target** | Optional | [Download](https://github.com/overextended/ox_target/releases) |
| **qb-target**  | Optional | Included with QBCore                                           |

> **\[NOTE]** You must use either `ox_target` or `qb-target`. The script supports both.

***

### 1. Framework Configuration

Open `config.lua` and set your framework options:

#### QBCore Settings

```lua
Config.Framework = "QB"
Config.CoreName = 'qb-core'
Config.MenuName = 'qb-menu'
Config.Target = "ox_target"       -- or "qb-target"
Config.CustomLicenseColumn = 'license'
```

#### ESX Settings

```lua
Config.Framework = "ESX"          -- or "oldESX" for legacy ESX
Config.CoreName = 'es_extended'
Config.MenuName = 'ox_lib'
Config.Target = "ox_target"
Config.CustomLicenseColumn = 'owner'
```

#### fxmanifest.lua - MySQL Driver

By default the script uses `oxmysql`. If you use `mysql-async`, open `fxmanifest.lua` and swap the comment:

```lua
server_scripts {
    "server.lua",
    "server_functions.lua",
    '@oxmysql/lib/MySQL.lua',
    --'@mysql-async/lib/MySQL.lua',  -- Uncomment for mysql-async
}
```

***

### 2. Importing Items

All crafting items in Car Crafting 2.0 are **managed from the in-game panel**. However, you still need to register the item definitions in your inventory system so players can hold them.

#### QBCore - `qb-core/shared/items.lua`

Add these at the bottom of the file:

```lua
['toolkit']        = { ['name'] = 'toolkit',        ['label'] = 'Toolkit',        ['weight'] = 100, ['type'] = 'item', ['image'] = 'toolkit.png',        ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['description'] = 'It is used to produce some things.' },
['car_door']           = { ['name'] = 'door',            ['label'] = 'Car Door',       ['weight'] = 100, ['type'] = 'item', ['image'] = 'door.png',           ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['description'] = 'Vehicle door for crafting.' },
['car_battery']    = { ['name'] = 'car_battery',     ['label'] = 'Car Battery',    ['weight'] = 100, ['type'] = 'item', ['image'] = 'car_battery.png',    ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['description'] = 'Vehicle battery for crafting.' },
['sparkplug']      = { ['name'] = 'sparkplug',       ['label'] = 'Sparkplug',      ['weight'] = 100, ['type'] = 'item', ['image'] = 'sparkplug.png',      ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['description'] = 'Sparkplug for engine crafting.' },
['wheel']          = { ['name'] = 'wheel',           ['label'] = 'Car Wheel',      ['weight'] = 100, ['type'] = 'item', ['image'] = 'wheel.png',          ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['description'] = 'Vehicle wheel for crafting.' },
['car_glass']      = { ['name'] = 'car_glass',       ['label'] = 'Car Glass',      ['weight'] = 100, ['type'] = 'item', ['image'] = 'car_glass.png',      ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['description'] = 'Vehicle glass for crafting.' },
['car_blueprint']  = { ['name'] = 'car_blueprint',   ['label'] = 'Car Blueprint',  ['weight'] = 100, ['type'] = 'item', ['image'] = 'car_blueprint.png',  ['unique'] = false, ['useable'] = false, ['shouldClose'] = false, ['description'] = 'Blueprint for vehicle crafting.' },
```

#### ESX - SQL Import

```sql
INSERT INTO `items` (`name`, `label`, `weight`) VALUES
  ('toolkit', 'Toolkit', 100),
  ('car_door', 'Car Door', 100),
  ('car_battery', 'Car Battery', 100),
  ('sparkplug', 'Sparkplug', 100),
  ('wheel', 'Car Wheel', 100),
  ('car_glass', 'Car Glass', 100),
  ('car_blueprint', 'Car Blueprint', 100);
```

#### OX Inventory - `ox_inventory/data/items.lua`

```lua
['toolkit']       = { label = 'Toolkit',       weight = 100 },
['car_door']          = { label = 'Car Door',      weight = 100 },
['car_battery']   = { label = 'Car Battery',   weight = 100 },
['sparkplug']     = { label = 'Sparkplug',     weight = 100 },
['wheel']         = { label = 'Car Wheel',     weight = 100 },
['car_glass']     = { label = 'Car Glass',     weight = 100 },
['car_blueprint'] = { label = 'Car Blueprint', weight = 100 },
```

> **\[IMPORTANT]** These are the **default items** that come with the script. You can add any custom items later via the Manager Panel but you must also register them in your inventory system.

***

### 3. Add Item Photos to Inventory

Copy the images from the `items_photo` folder into your inventory's image directory.

* **QBCore:** `qb-inventory/html/images/`
* **OX Inventory:** `ox_inventory/web/images/`
* **ESX:** Your inventory's image folder

Then update the path in `config.lua`:

```lua
Config.InventoryItemImagePath = 'ox_inventory/web/images/'
```

***

### Setup Finished 🎉

Start your server. The script will automatically:

1. Create all required database tables
2. Insert default data (items, vehicles, areas, types)
3. Load runtime configuration

You're ready to use the in-game manager panel!

***

## Manager Panel

The Manager Panel is the core feature of Car Crafting 2.0. It provides a full CRUD interface for managing all crafting data directly from the game **no config files, no server restarts**.

### Opening the Panel

Use the command configured in `config.lua`:

```
/carCraftingManage
```

> **\[NOTE]** Only players with **admin permissions** can access the manager panel. For QBCore, this requires `admin` permission or ace `command` access. For ESX, the player must be in the `admin` or `superadmin` group.

The panel toggle key (default `F9`) can be used to hide/show the manager while it's open.

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FXxyPhEiNJaZj0Y9KZEp5%2Fimage.png?alt=media&#x26;token=ea977dd3-320e-4f6c-af88-bde9539dbcdf" alt=""><figcaption></figcaption></figure>

### Panel Sections

The manager has **4 main sections** accessible from the left sidebar:

| Section            | Purpose                                          |
| ------------------ | ------------------------------------------------ |
| **Crafting Items** | Define parts/materials required for crafting     |
| **Craft Areas**    | Configure zones, job access, and locations       |
| **Vehicles**       | Manage craftable vehicles with parts and chances |
| **Vehicle Types**  | Create categories to group vehicles              |

#### Workflow Order

For a fresh setup, follow this order:

```
1. Vehicle Types → 2. Crafting Items → 3. Vehicles → 4. Craft Areas
```

After making changes, click the **INITIALIZE** button at the bottom of the panel to reload the runtime configuration.

***

## Vehicle Types

Vehicle Types are used to categorize vehicles in the crafting menus. When a player opens the crafting UI at a location, vehicles are grouped by their assigned type.

### Creating a Vehicle Type

1. Navigate to **Vehicle Types** in the manager panel
2. Click **+ New Type**
3. Enter a **Label** (e.g., "Helicopters", "Sedans", "Off-Road")
4. Click **Save**

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2Fjp9a7E8quB88S9xB9aTi%2Fimage.png?alt=media&#x26;token=acfd0e98-be0e-4e01-8d9b-477793be874c" alt=""><figcaption></figcaption></figure>

### Default Types

The script comes with these default types:

| Type        | Slug          |
| ----------- | ------------- |
| Helicopters | `helicopters` |
| Sedans      | `sedans`      |
| Off-Road    | `off-road`    |
| Planes      | `planes`      |
| Motorcycles | `motorcycles` |
| Boats       | `boats`       |

> **\[TIP]** You can create any custom types like "Luxury Cars", "Emergency Vehicles", "Military", etc.

***

## Crafting Items

Crafting Items are the parts/materials that players need in their inventory to craft a vehicle. Each item has its own animation, sound effect, particle effect, and installation time.

### Managing Items

Navigate to **Crafting Items** in the manager panel.

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2Fr8QqviyKLif181yTEA2k%2Fimage.png?alt=media&#x26;token=94d148a4-a88b-49cb-bf55-62757de1b9ca" alt=""><figcaption></figcaption></figure>

### Creating a New Item

Click **+ New Item** and fill in the form:

| Field              | Description                                | Example                          |
| ------------------ | ------------------------------------------ | -------------------------------- |
| **Item Name**      | Technical name (must match inventory item) | `car_battery`                    |
| **Label**          | Display name shown to players              | `Car Battery`                    |
| **Color**          | Color tag for the UI                       | `#013e5d`                        |
| **Description**    | Item description                           | `Provides power for the vehicle` |
| **Install Time**   | Duration of installation animation (ms)    | `5000`                           |
| **Stage Label**    | Text shown during installation             | `Installing Car Battery`         |
| **Sound URL**      | YouTube/audio URL played during install    | `https://youtube.com/...`        |
| **Sound Volume**   | Volume level (0.0 - 1.0)                   | `0.4`                            |
| **Animation Dict** | GTA animation dictionary                   | `mini@repair`                    |
| **Animation Name** | GTA animation name                         | `fixing_a_ped`                   |
| **Particle Core**  | Particle effect core                       | `core`                           |
| **Particle Name**  | Particle effect name                       | `ent_amb_foundry_arc_heat`       |
| **Default Part**   | Auto-select for new vehicles               | ✅ / ❌                            |

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FbLvcdqDMRqcI7LS8g0Xf%2Fimage.png?alt=media&#x26;token=03e30471-304a-40a2-9e6c-e10fc537ecc3" alt=""><figcaption></figcaption></figure>

#### Default Parts

When **Default Part** is enabled, this item will be automatically added to the parts list when creating a new vehicle. This saves time when most vehicles use the same base materials.

***

## Vehicles

Vehicles are the craftable models that players can build at craft areas.

### Managing Vehicles

Navigate to **Vehicles** in the manager panel.

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FLP1vYFjbC5MvdwPmtcTg%2Fimage.png?alt=media&#x26;token=86863b27-2261-4b74-9ac9-8a10f0c3bab5" alt=""><figcaption></figcaption></figure>

### Creating a New Vehicle

Click **+ New Vehicle** and fill in the form:

| Field                  | Description                             | Example     |
| ---------------------- | --------------------------------------- | ----------- |
| **Vehicle Name**       | Display name                            | `Sultan RS` |
| **Model Name**         | GTA spawn model name                    | `sultanrs`  |
| **Vehicle Type**       | Assign to a type category               | `Sedans`    |
| **Success Chance (%)** | Probability of successful craft (1-100) | `20`        |
| **Required Parts**     | Items needed + quantities               | Various     |

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FhKUVDFBasxXqvrYv4Oc1%2Fimage.png?alt=media&#x26;token=268cd790-6dd8-495b-a109-bacc31f827a4" alt=""><figcaption></figcaption></figure>

#### Adding Required Parts

Use the **+ Add Part** button to add crafting requirements. Each part consists of:

* **Item** Select from your defined Crafting Items
* **Quantity** How many of this item is needed

> **\[NOTE]** If you have **Default Parts** configured, they will be pre-populated when creating a new vehicle. You can add, remove, or change quantities as needed.

#### Craft Chance System

The **Success Chance** determines the probability of a successful craft:

* **100%** Always succeeds
* **50%** 50/50 chance
* **20%** Very rare, high-value vehicles

When crafting fails, the player loses all materials and receives a failure notification. In the player UI, vehicles are sorted by craft chance (highest to lowest).

***

## Craft Areas

Craft Areas are the zones on the map where players can craft vehicles. Each area can have multiple locations, job restrictions, and custom music settings.

### Managing Craft Areas

Navigate to **Craft Areas** in the manager panel.

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FFMtlAdKBGrHhMDinZNdC%2Fimage.png?alt=media&#x26;token=d555b266-6ebf-4b97-b4d8-c604de63cbb0" alt=""><figcaption></figcaption></figure>

### Creating a New Craft Area

Click **+ New Area** and fill in the form:

| Field                 | Description                       | Example                   |
| --------------------- | --------------------------------- | ------------------------- |
| **Area Name**         | Technical/display name            | `General Mechanic`        |
| **Job Access**        | Restrict to jobs or everyone      | `mechanic` or `EVERYONE`  |
| **Music Enabled**     | Enable crafting background music  | ✅                         |
| **Craft Music URL**   | YouTube/audio URL for crafting    | `https://youtube.com/...` |
| **Music Volume**      | Crafting music volume (0.0 - 1.0) | `0.1`                     |
| **Success Music URL** | Music played on successful craft  | `https://youtube.com/...` |
| **Success Volume**    | Success music volume (0.0 - 1.0)  | `0.1`                     |

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FMXHrvKri0WC72mgqpVFa%2Fimage.png?alt=media&#x26;token=949c27c7-aabc-457a-9247-7d08c94e83a9" alt=""><figcaption></figcaption></figure>

#### Job Access

* Set to **EVERYONE** to allow all players
* Enter specific job names (e.g., `mechanic`, `police`) to restrict access
* Multiple jobs can be added separated by commas

> **\[TIP]** Use this to create themed areas: "Mechanic Workshop" (mechanic only), "Military Base" (military only), "Public Garage" (everyone).

***

### Locations

Each Craft Area can have **multiple locations** on the map. This means you can create one area like "Mechanic Workshop" and place it in different parts of the city.

#### Adding a Location

1. Click the **(location icon)** on a craft area row
2. In the locations popup, click **+ New Location**
3. Fill in the location form:

| Field                    | Description                                       | Example                         |
| ------------------------ | ------------------------------------------------- | ------------------------------- |
| **Location Name**        | Name shown on blip                                | `Benny's Car Crafting`          |
| **Show Blip**            | Display on the map                                | ✅                               |
| **Blip Sprite**          | Map icon ID                                       | `326`                           |
| **Blip Color**           | Map icon color ID                                 | `47`                            |
| **Blip Scale**           | Map icon size                                     | `0.7`                           |
| **Blip Coordinates**     | Map blip position (x,y,z)                         | `-222.87,-1331.65,31.62`        |
| **Debug Mode**           | Show PolyZone borders in-game                     | ❌                               |
| **Thickness**            | Zone height                                       | `4.0`                           |
| **PolyZone Coordinates** | Border points of the crafting area                | Multiple vec3 points            |
| **Spawn Coordinates**    | Where the crafted vehicle appears (x,y,z,heading) | `-205.97,-1323.87,30.28,356.76` |

#### Getting Coordinates In-Game

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2F9GJ3lVjJFFxAeZ0JEzBu%2Fimage.png?alt=media&#x26;token=e5470b4b-580d-4252-9122-11925e2a7340" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2F7BIJZHwZyOthPHInmMZo%2Fimage.png?alt=media&#x26;token=83fdfe97-2e5c-4fe8-b239-3c3fbcb835a8" alt=""><figcaption></figcaption></figure>

You can use the manager panel to get your current coordinates:

* Use the coordinate copy buttons in the location edit form
* Or use any coordinate display script to get exact positions

#### Vehicle Spawn Points

Each location needs **Vehicle Spawn Points** the positions where unfinished vehicles appear for crafting interaction.

1. In the location form, go to **Vehicle Coordinates** section
2. Click **+ New Vehicle Coordinate**
3. Select a **Vehicle** from the dropdown
4. Enter **Coordinates** (x,y,z,heading)

You can add multiple spawn points per location with different vehicles.

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2Fqb9j4Y5haYy75mm8r5ft%2Fimage.png?alt=media&#x26;token=904de1f1-b75b-4ff1-9d86-fb20ae545c7f" alt=""><figcaption></figcaption></figure>

#### Location Sub-Categories

Each location can have **Sub-Categories** to organize vehicles within the crafting UI. For example, a mechanic location might have:

* 🚗 Sedan Cars
* 🏍️ Motorcycles
* 🚙 SUVs & Off-Roads

Sub-categories include:

* **Name** - Technical identifier
* **Label** - Display name
* **Icon** - Material Symbols icon name
* **Order** - Display order
* **Vehicles** - Which vehicles appear in this category

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FkwQWpvcarlLiVVwzdSBA%2Fimage.png?alt=media&#x26;token=1a3e4e42-0066-4b43-a30b-590edec3dbe2" alt=""><figcaption></figcaption></figure>

***

## Player Crafting Experience

This section describes what players see and experience during the crafting process.

### Entering a Craft Zone

When a player enters a PolyZone area:

1. Pre-crafted vehicle models spawn at configured positions (damaged, no wheels, no doors)
2. A creeper prop appears under each vehicle
3. Spawn particle effects play

### Starting a Craft

1. Player approaches a vehicle and uses the **target interaction** (ox\_target or qb-target)
2. The crafting UI opens with a **cinematic camera** focused on the vehicle
3. The UI shows:
   * Vehicle name and model
   * Craft success chance percentage
   * Required parts list with color-coded availability (✅ owned / ❌ missing)
4. Player clicks **START CRAFT**

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FS00VDRomIwnV3xUhQeci%2Fimage.png?alt=media&#x26;token=0766e12c-65f8-4cb6-872e-4e825d38d03f" alt=""><figcaption></figcaption></figure>

### Crafting Process

After starting, the crafting process is **interactive and animated**:

1. **Item Check** Server validates all required items in player inventory
2. **Part-by-Part Installation** For each part:
   * A **green marker** appears at the installation point
   * Text shows `[E] Part Name x1 (2/7)`
   * Player walks to the marker and presses **E**
   * The item is removed from inventory
   * The character plays the configured animation
   * Sound effects and particles play
3. **Special Animations:**
   * **Wheels** → Player goes to each wheel bone position
   * **Doors** → Player goes to each door bone position
   * **Other Parts** → Player goes to the driver-side door area
4. **Progress Bar** Updates in real-time as each part is installed

<figure><img src="https://2065585120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq7HrDnyk8Su9fbU8m4ZV%2Fuploads%2FoN8FIU1Fiu5sQGvwyCdf%2Fimage.png?alt=media&#x26;token=c732f3c5-ed23-432b-9c39-956cadf775cd" alt=""><figcaption></figcaption></figure>

### Craft Completion

When all parts are installed:

1. **Craft Chance Roll** Server rolls against the vehicle's success chance
2. **On Success:**
   * Screen fades out
   * Old vehicle is replaced with a clean, fully working vehicle
   * The vehicle is registered to the player in the database
   * Cinematic camera showcase plays (if enabled)
   * Success music plays
   * Screen fades back in
   * Player receives success notification
3. **On Failure:**
   * All materials are lost
   * Player receives a failure notification
   * Vehicle returns to its pre-craft state

### Discord Webhook

If configured, a Discord webhook sends a log message for every successful craft including:

* Player ID and name
* Vehicle model
* License identifier

***

## Config Reference

### config.lua - Full Reference

| Option                                      | Type        | Default                      | Description                              |
| ------------------------------------------- | ----------- | ---------------------------- | ---------------------------------------- |
| `Config.Language`                           | string      | `'en'`                       | Language: `en`, `tr`, `de`, `fr`         |
| `Config.Debug`                              | boolean     | `false`                      | Enable debug prints                      |
| `Config.Framework`                          | string      | `"QB"`                       | Framework: `QB`, `ESX`, `oldESX`         |
| `Config.CoreName`                           | string      | `'qb-core'`                  | Core resource name                       |
| `Config.MenuName`                           | string      | `'qb-menu'`                  | Menu resource: `qb-menu`, `ox_lib`       |
| `Config.Target`                             | string      | `"ox_target"`                | Target system: `qb-target`, `ox_target`  |
| `Config.CustomLicenseColumn`                | string      | `'license'`                  | DB column for vehicle ownership          |
| `Config.ManageCommand`                      | string      | `'carCraftingManage'`        | Admin panel open command                 |
| `Config.ManagerToggleKey`                   | string      | `'F9'`                       | Key to toggle manager visibility         |
| `Config.Webhook`                            | string\|nil | `nil`                        | Discord webhook URL                      |
| `Config.InventoryItemImagePath`             | string      | `'ox_inventory/web/images/'` | Path to inventory item images            |
| `Config.EnableCinematicShowOnCraftFinished` | boolean     | `true`                       | Enable cinematic camera on craft success |
| `Config.CameraDistance`                     | float       | `7.0`                        | Cinematic camera distance                |
| `Config.CameraPov`                          | float       | `25.0`                       | Camera point of view angle               |
| `Config.CameraTurnSpeed`                    | float       | `0.001`                      | Camera rotation speed                    |
| `Config.CameraAngle`                        | float       | `0.0`                        | Camera starting angle                    |
| `Config.CameraHeight`                       | float       | `0.4`                        | Camera height offset                     |
| `Config.CustomSteamIdentifier`              | boolean     | `false`                      | Use Steam ID instead of license (QB)     |
| `Config.EnableCraftParticle`                | boolean     | `true`                       | Show particles during crafting           |
| `Config.EnableCarSpawnParticle`             | boolean     | `true`                       | Show particles when vehicles spawn       |
| `Config.CraftFadeOutTime`                   | integer     | `1000`                       | Screen fade out duration (ms)            |
| `Config.CraftFadeInTime`                    | integer     | `12000`                      | Screen fade in duration (ms)             |
| `Config.PlateLetters`                       | integer     | `3`                          | Number of letters in generated plates    |
| `Config.PlateNumbers`                       | integer     | `3`                          | Number of numbers in generated plates    |
| `Config.PlateUseSpace`                      | boolean     | `true`                       | Add space between letters and numbers    |
| `Config.JapaneseStylePlate`                 | boolean     | `false`                      | Use Japanese format (XX-XX) plates       |

***

## Customization

### Custom Functions `functions.lua`

The script provides several events you can customize:

#### Notification

```lua
RegisterNetEvent('qubit-carcrafting:notification', function(msg, type)
    -- type: "error", "success", "info"
    -- Replace with your own notification system
    TriggerEvent('qubit-carcrafting:client:notification', msg, type)
end)
```

#### Fuel System

```lua
RegisterNetEvent('qubit-carcrafting:fuel', function(veh)
    -- Set fuel on the spawned vehicle
    -- Replace with your fuel system export
    TriggerEvent('qubit-carcrafting:client:fuel', veh, 100)
end)
```

#### Screen Fade Events

```lua
RegisterNetEvent('qubit-carcrafting:screenFadeIn', function()
    -- Called when screen fades in after craft
    -- Example: exports['vms_hud']:Display(true)
end)

RegisterNetEvent('qubit-carcrafting:screenFadeOut', function()
    -- Called when screen fades out during craft
    -- Example: exports['vms_hud']:Display(false)
end)
```

#### Vehicle Key System

```lua
RegisterNetEvent('qubit-carcrafting:vehicleLockSave', function(veh)
    -- Give vehicle keys to the player
    -- Automatically detects framework
end)
```

### Localization

Edit `locales.lua` to add or modify languages. The script supports:

* 🇬🇧 English (`en`)
* 🇹🇷 Turkish (`tr`)
* 🇩🇪 German (`de`)
* 🇫🇷 French (`fr`)

Set your language in config:

```lua
Config.Language = 'en'
```

***

## Database Schema

Car Crafting 2.0 automatically creates and manages these tables:

| Table                                      | Purpose                                                   |
| ------------------------------------------ | --------------------------------------------------------- |
| `qubit_carcrafting_craft_areas`            | Craft area definitions with job access and music settings |
| `qubit_carcrafting_items`                  | Crafting item definitions with animations and effects     |
| `qubit_carcrafting_area_locations`         | Physical locations for each craft area (blips, zones)     |
| `qubit_carcrafting_area_car_coords`        | Vehicle spawn positions within locations                  |
| `qubit_carcrafting_vehicles`               | Craftable vehicle definitions with craft chance           |
| `qubit_carcrafting_vehicle_parts`          | Required items per vehicle                                |
| `qubit_carcrafting_vehicle_types`          | Vehicle type/category definitions                         |
| `qubit_carcrafting_location_subcategories` | Sub-categories per location for UI grouping               |
| `qubit_carcrafting_subcategory_vehicles`   | Vehicle assignments to sub-categories                     |

> **\[NOTE]** All tables are created automatically on first start. Default data is inserted only when tables are empty. You do **not** need to import any SQL manually.

***

### File Structure

```
qubit-carcrafting/
├── config.lua              # Main configuration
├── functions.lua           # Customizable client events
├── locales.lua             # Multi-language support (en, tr, de, fr)
├── client.lua              # Client-side logic (zones, camera, crafting)
├── server.lua              # Server-side logic (DB, admin panel, craft logic)
├── server_functions.lua    # Framework-specific helper functions
├── fxmanifest.lua          # Resource manifest
├── items_photo/            # Default item images for inventory
└── html/
    ├── index.html          # NUI page
    ├── script.js           # UI logic (manager + player crafting)
    ├── style.css           # UI styling
    └── img/                # UI assets
```

***

> **Need help?** Join our [Discord](https://discord.gg/M4ms6RyxMW) for support.
