# configuration

## Main Config File

Location: `shared/config.lua`

### Language Setting

```lua
Config = {}

Config.Locale = 'en' -- Available: 'en', 'pl'
```

***

## Dealer Configuration Example

```lua
Config.dealers = {
    ['Nova Imports'] = {
        dealerZone = {
            enable = true,
            coords = vec3(-786.02, -223.39, 36.0),
            size = vec3(30, 40.0, 11.5),
            rotation = 30.0,
            debug = false,
        },
        blip = {
            enable = true,
            sprite = 227,
            color = 5,
            scale = 0.8,
            shortRange = true,
            name = "Nova Imports"
        },
        createNUI = {
            target = {
                coords = vec3(-781.8272, -231.5138, 37.1566),
                size = vec3(1.0, 1.0, 1.0),
                rotation = vec3(0.0, 0.0, 300.0),
                debug = false,
                distance = 2.5,
            },
            camera = {
                coords = vec3(-786.6729, -234.9732, 40.1866),
                rotation = vec3(-30.0, -0.0, 203.1666),
                fov = 90.0
            },
            vehicle = {
                coords = vec3(-784.2449, -240.5233, 37.3513),
                heading = 82.0,
                TestDrive = {
                    enable = true,
                    coords = vec3(-786.5511, -253.2086, 37.0766),
                    heading = 160.0,
                    duration = 120,
                    cost = 500,
                    costPerNotReturnVehicle = 1000,
                    returnvehZone = {
                        coords = vec3(-786.5511, -253.2086, 37.0766),
                        size = vec3(5.0, 5.0, 5.0),
                        rotation = 0.0,
                        debug = true,
                    }
                },
                buyResult = {
                    coords = vec3(-790.0, -242.0, 37.0),
                    heading = 160.0,
                },
                RandomTuning = true,
            }
        },
        showRoom = {
            enable = true,
            dui = {
                type = "replace",
                replace = {
                    prop = "int_luxshowroom_screens_banners",
                    texture = "luxshowroomscreen2"
                },
                resolution = {
                    width = 2440,
                    height = 1440
                },
                interactions = {
                    {
                        target = {
                            coords = vec3(-798.0740, -220.7029, 37.1567),
                            size = vec3(1.0, 1.0, 1.0),
                            rotation = vec3(0.0, 0.0, 300.0),
                            debug = false,
                            distance = 2.5,
                        },
                        camera = {
                            coords = vec3(-798.4127, -221.2621, 37.3767),
                            rotation = vec3(0.0, -1.0, 332.3121),
                            fov = 20.0
                        }
                    },
                }
            },
            carSpawn = {
                removeVehTime = 50,
                carOptions = {
                    coords = vec3(-789.3836, -215.2570, 37.5108),
                    heading = 120.0,
                    canTuning = true,
                    randomTuning = true,
                }
            }
        }
    },
}
```

***

## Config Options Reference

### Locale

| Option        | Type   | Default | Description                                    |
| ------------- | ------ | ------- | ---------------------------------------------- |
| Config.Locale | string | 'en'    | Language for the script. Available: 'en', 'pl' |

***

### Dealer Zone

The main zone where the dealer operates. When player enters this zone, DUI showroom becomes active.

| Option   | Type    | Default             | Description                              |
| -------- | ------- | ------------------- | ---------------------------------------- |
| enable   | boolean | true                | Enable/disable the dealer zone           |
| coords   | vec3    | -                   | Center coordinates of the zone           |
| size     | vec3    | vec3(5.0, 5.0, 5.0) | Size of the zone (width, length, height) |
| rotation | number  | 0.0                 | Rotation of the zone in degrees          |
| debug    | boolean | false               | Show debug box for zone visualization    |

***

### Blip

Map blip configuration for the dealership.

| Option     | Type    | Default | Description                             |
| ---------- | ------- | ------- | --------------------------------------- |
| enable     | boolean | true    | Enable/disable the blip on map          |
| sprite     | number  | 227     | Blip sprite ID (see GTA V blip sprites) |
| color      | number  | 5       | Blip color ID                           |
| scale      | number  | 0.8     | Size of the blip on map                 |
| shortRange | boolean | true    | Only show blip when player is nearby    |
| name       | string  | -       | Name displayed on the map               |

***

### Create NUI

Configuration for the NUI-based vehicle catalog (opened via target interaction).

#### Target

| Option   | Type    | Default             | Description                              |
| -------- | ------- | ------------------- | ---------------------------------------- |
| coords   | vec3    | -                   | Position of the target interaction point |
| size     | vec3    | vec3(1.0, 1.0, 1.0) | Size of the target zone                  |
| rotation | vec3    | vec3(0, 0, 0)       | Rotation of the target zone              |
| debug    | boolean | false               | Show debug visualization                 |
| distance | number  | 2.5                 | Maximum interaction distance             |

#### Camera

| Option   | Type   | Default | Description                        |
| -------- | ------ | ------- | ---------------------------------- |
| coords   | vec3   | -       | Camera position coordinates        |
| rotation | vec3   | -       | Camera rotation (pitch, roll, yaw) |
| fov      | number | 90.0    | Field of view (lower = more zoom)  |

#### Vehicle

| Option       | Type    | Default | Description                        |
| ------------ | ------- | ------- | ---------------------------------- |
| coords       | vec3    | -       | Spawn position for preview vehicle |
| heading      | number  | 0.0     | Vehicle heading/rotation           |
| RandomTuning | boolean | true    | Enable random tuning button in UI  |

***

### Test Drive

Configuration for the test drive system.

| Option                  | Type    | Default | Description                            |
| ----------------------- | ------- | ------- | -------------------------------------- |
| enable                  | boolean | true    | Enable/disable test drive feature      |
| coords                  | vec3    | -       | Spawn position for test drive vehicle  |
| heading                 | number  | 0.0     | Vehicle heading when spawned           |
| duration                | number  | 120     | Test drive duration in seconds         |
| cost                    | number  | 500     | Cost to start a test drive             |
| costPerNotReturnVehicle | number  | 1000    | Penalty per 10 seconds if not returned |

#### Return Zone

| Option   | Type    | Default             | Description               |
| -------- | ------- | ------------------- | ------------------------- |
| coords   | vec3    | -                   | Center of the return zone |
| size     | vec3    | vec3(5.0, 5.0, 5.0) | Size of the return zone   |
| rotation | number  | 0.0                 | Rotation of the zone      |
| debug    | boolean | false               | Show debug visualization  |

***

### Buy Result

Where the purchased vehicle spawns.

| Option  | Type   | Default | Description                          |
| ------- | ------ | ------- | ------------------------------------ |
| coords  | vec3   | -       | Spawn position for purchased vehicle |
| heading | number | 0.0     | Vehicle heading                      |

***

### ShowRoom

Configuration for the DUI showroom system (displays on in-game screens).

| Option | Type    | Default | Description             |
| ------ | ------- | ------- | ----------------------- |
| enable | boolean | true    | Enable/disable showroom |

#### DUI

| Option            | Type   | Values             | Description                     |
| ----------------- | ------ | ------------------ | ------------------------------- |
| type              | string | "replace" / "prop" | DUI display method              |
| replace.prop      | string | -                  | Prop name to replace texture on |
| replace.texture   | string | -                  | Texture name to replace         |
| resolution.width  | number | 2440               | DUI render width                |
| resolution.height | number | 1440               | DUI render height               |

#### DUI Interactions

Array of interaction points for the showroom.

| Option | Type   | Description                                          |
| ------ | ------ | ---------------------------------------------------- |
| target | object | Target zone configuration (same as createNUI.target) |
| camera | object | Camera configuration (same as createNUI.camera)      |

#### Car Spawn

| Option                  | Type    | Default | Description                                     |
| ----------------------- | ------- | ------- | ----------------------------------------------- |
| removeVehTime           | number  | 50      | Seconds before showroom vehicle is auto-removed |
| carOptions.coords       | vec3    | -       | Vehicle spawn position in showroom              |
| carOptions.heading      | number  | 0.0     | Vehicle heading                                 |
| carOptions.canTuning    | boolean | true    | Enable tuning menu for showroom vehicles        |
| carOptions.randomTuning | boolean | true    | Enable random tuning option                     |

#### Other Place (Optional)

Teleport player to a separate showroom location.

| Option                     | Type   | Description                         |
| -------------------------- | ------ | ----------------------------------- |
| otherPlace.exitInteraction | object | Target configuration for exit point |
| otherPlace.spawnCoords     | vec3   | Teleport destination                |
