> For the complete documentation index, see [llms.txt](https://zloma-scripts.gitbook.io/zloma-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zloma-scripts.gitbook.io/zloma-scripts/zloma_vehicleshop-paid/configuration.md).

# Configuration

All primary configuration lives in `config.lua`. This file is **not escrowed** and is safe to edit.

Additional server-side webhook settings and post-action hooks are in `sv_customization.lua`.

Additional client-side integration hooks are in `cl_customization.lua`.

***

## General

| Option               | Type    | Default                           | Description                            |
| -------------------- | ------- | --------------------------------- | -------------------------------------- |
| `Config.Debug`       | boolean | `false`                           | Enable verbose debug logging           |
| `Config.Language`    | string  | `'en'`                            | Active locale (`'en'` or `'hr'`)       |
| `Config.AdminGroups` | table   | `{'admin', 'headadmin', 'owner'}` | Groups allowed to open the admin tools |

***

## Test Drive

| Option                      | Type   | Default | Description                     |
| --------------------------- | ------ | ------- | ------------------------------- |
| `Config.TestDrive.duration` | number | `15`    | Length of test drive in seconds |

Test drives use isolated routing buckets so the player can drive in a private session without interfering with showroom logic.

***

## Tuning Preview

| Option                         | Type    | Default | Description                                  |
| ------------------------------ | ------- | ------- | -------------------------------------------- |
| `Config.TuningPreview.enabled` | boolean | `true`  | Enable visual tuning preview inside the shop |

This preview is cosmetic only. Selected tuning is not transferred to the purchased vehicle unless you implement that separately.

***

## Trade-In

Global trade-in settings define the defaults used by salons. Individual shops can override the percentage in the database/admin flow.

| Option                             | Type    | Default | Description                                            |
| ---------------------------------- | ------- | ------- | ------------------------------------------------------ |
| `Config.TradeIn.enabled`           | boolean | `true`  | Master switch for the trade-in system                  |
| `Config.TradeIn.defaultPercentage` | number  | `30`    | Default percentage of market price offered on trade-in |
| `Config.TradeIn.maxPercentage`     | number  | `80`    | Highest trade-in percentage admins can set             |
| `Config.TradeIn.minPercentage`     | number  | `5`     | Lowest trade-in percentage admins can set              |

***

## Showroom Camera

| Option                               | Type   | Default | Description                             |
| ------------------------------------ | ------ | ------- | --------------------------------------- |
| `Config.Showroom.cameraFov`          | number | `50.0`  | Default showroom camera FOV             |
| `Config.Showroom.cameraDistance`     | number | `6.0`   | Distance from camera to preview vehicle |
| `Config.Showroom.cameraHeight`       | number | `0.6`   | Vertical offset above vehicle center    |
| `Config.Showroom.transitionDuration` | number | `500`   | Camera transition speed in milliseconds |

***

## Plate Generation

| Option               | Type   | Default | Description                                                   |
| -------------------- | ------ | ------- | ------------------------------------------------------------- |
| `Config.PlatePrefix` | string | `'ZLM'` | Up to 4 alphanumeric characters prepended to generated plates |

Examples:

* Prefix mode: `ZLM12345`
* Empty prefix: random letters and digits such as `ABCD1234`

***

## Discord Logging

`Config.DiscordLogs` controls which categories are allowed to send webhook payloads.

| Option                             | Type    | Default | Description                              |
| ---------------------------------- | ------- | ------- | ---------------------------------------- |
| `Config.DiscordLogs.enabled`       | boolean | `true`  | Master switch for Discord logs           |
| `Config.DiscordLogs.purchases`     | boolean | `true`  | Log purchases                            |
| `Config.DiscordLogs.testdrives`    | boolean | `false` | Log test drive starts                    |
| `Config.DiscordLogs.tradein`       | boolean | `true`  | Log trade-ins                            |
| `Config.DiscordLogs.adminActions`  | boolean | `true`  | Log salon/vehicle/category admin changes |
| `Config.DiscordLogs.debugResponse` | boolean | `false` | Print webhook response info to console   |

Webhook URLs are defined in `sv_customization.lua`:

| Option                   | Type   | Default | Description              |
| ------------------------ | ------ | ------- | ------------------------ |
| `Config.WebhookPurchase` | string | `''`    | Purchase log webhook     |
| `Config.WebhookTradeIn`  | string | `''`    | Trade-in log webhook     |
| `Config.WebhookAdmin`    | string | `''`    | Admin action log webhook |

***

## Business Mode

Business mode is a full management layer on top of regular dealership gameplay.

| Option                                      | Type    | Default          | Description                                               |
| ------------------------------------------- | ------- | ---------------- | --------------------------------------------------------- |
| `Config.Business.enabled`                   | boolean | `true`           | Master switch for the entire business system              |
| `Config.Business.defaultProcurementPercent` | number  | `50`             | Default order cost percent based on vehicle max price     |
| `Config.Business.minProcurementPercent`     | number  | `10`             | Lowest procurement percent admins can set                 |
| `Config.Business.maxProcurementPercent`     | number  | `90`             | Highest procurement percent admins can set                |
| `Config.Business.towTruckModel`             | string  | `'flatbed3'`     | Model used for delivery jobs                              |
| `Config.Business.attachRadius`              | number  | `5.0`            | Max attach radius when loading a vehicle onto the flatbed |
| `Config.Business.defaultPickupCoords`       | table   | warehouse coords | Fallback pickup location when a shop does not define one  |

### Job Grades

Job grade labels are locale-aware and populated after locale loading:

| Grade | Name          | Intended Role        |
| ----- | ------------- | -------------------- |
| `0`   | `Salesperson` | Basic employee       |
| `1`   | `Manager`     | Mid-level management |
| `2`   | `Owner`       | Full control         |

***

## Client Customization Hooks

`cl_customization.lua` provides optional functions you can define:

| Hook                                      | Purpose                                       |
| ----------------------------------------- | --------------------------------------------- |
| `OnShopOpen(shopData)`                    | Run custom code when the dealership UI opens  |
| `OnShopClose()`                           | Run custom code when the dealership UI closes |
| `OnVehiclePurchased(plate, model, price)` | React to successful purchases                 |
| `OnTestDriveStart(model)`                 | React when a test drive begins                |
| `OnTestDriveEnd()`                        | React when a test drive ends                  |

The client also exposes a generic event for external integrations:

* `zloma_vehicleshop:shopToggle` with `true` when open and `false` when closed

***

## Server Customization Hooks

`sv_customization.lua` provides optional functions you can define:

| Hook                                                                             | Purpose                              |
| -------------------------------------------------------------------------------- | ------------------------------------ |
| `OnServerVehiclePurchased(source, plate, spawnName, price, shopName)`            | Run logic after a completed purchase |
| `OnServerTradeInCompleted(source, oldPlate, newPlate, tradeinValue, finalPrice)` | Run logic after a completed trade-in |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://zloma-scripts.gitbook.io/zloma-scripts/zloma_vehicleshop-paid/configuration.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.
