> For the complete documentation index, see [llms.txt](https://acestudios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://acestudios.gitbook.io/docs/jobs-and-economy/p2p-vehicle-marketplace/configuration.md).

# Configuration

Every customer setting in ace\_p2pmarketplace/config.lua.

All customer settings are in `config.lua`. Most default to **`'auto'`**, which means they're detected on start. Check the server console for what was detected. Replace `'auto'` with a value to force it. Manual values are validated and logged the same way.

{% hint style="danger" %}
`config.lua` is sent to **every player**. Never put API keys or webhook URLs in it. See [Secrets](#server-only-secrets).
{% endhint %}

## Auto-detection summary

| Setting                                     | Auto behavior                                                                                                                                                                               |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Framework`                                 | `qbx_core` → `qbox`, `qb-core` → `qbcore`, `es_extended` → `esx`                                                                                                                            |
| `Locale`                                    | `ox:locale` / `esx:locale` / `qb_locale` convar if that language exists, otherwise `en`                                                                                                     |
| `Payment.BankAccount` / `CashAccount`       | `bank` / `money` on ESX. `bank` / `cash` on QBCore/Qbox                                                                                                                                     |
| `Garage.Resource`                           | okokGarage, esx\_garage, qbx\_garages / qb-garages, otherwise plain vehicle-table storage                                                                                                   |
| `Garage.DefaultGarage` / `AvailableGarages` | The garage resource's public garages (esx\_garage, qbx\_garages), otherwise public-looking garage names from your vehicle table. Impound, job, house and boat/air garages are never picked. |
| `Keys.Resource`                             | The first supported key resource that's running, otherwise the built-in keys                                                                                                                |
| `Photos.Enabled` / `Required`               | On when `screenshot-basic` is running                                                                                                                                                       |
| `Photos.Storage`                            | `fivemanage` when the Fivemanage key convar is set, otherwise `resource`                                                                                                                    |
| `MarketplaceOwner.Enabled`                  | On when `Identifiers` has entries                                                                                                                                                           |
| `Discord.Enabled`                           | On when the webhook convar is set                                                                                                                                                           |

## General

| Option                    | Default    | Description                                                                                                                                                |
| ------------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Debug`            | `false`    | Detailed logs. Can also be turned on with `set ace_marketplace_debug true`.                                                                                |
| `Config.Framework`        | `'auto'`   | Override: `'esx'`, `'qbcore'`, `'qbox'`.                                                                                                                   |
| `Config.Locale`           | `'en'`     | `'en'`, `'de'`, `'es'`, `'fr'`, `'pt'`, `'ar'`. The config comment says the ox\_lib / ESX / QBCore locale convar is used when available, otherwise `'en'`. |
| `Config.Currency`         | `'$'`      | Currency symbol.                                                                                                                                           |
| `Config.CurrencyPosition` | `'prefix'` | `'prefix'` or `'suffix'`.                                                                                                                                  |

## Marketplace access

```lua
Config.OpenCommand = 'marketplace'
Config.OpenKey = ''
Config.UseLocations = true
Config.InteractionRadius = 2.0

Config.Locations = {
    { coords = vector3(-378.79, -140.5, 38.68), label = 'Vehicle Marketplace', blip = { sprite = 225, color = 2, scale = 0.8 } },
}
```

| Option              | Description                                                                                                    |
| ------------------- | -------------------------------------------------------------------------------------------------------------- |
| `OpenCommand`       | The one command for everyone. Admins and fee owners get their tabs automatically.                              |
| `OpenKey`           | Default key for the open command, for example `'F5'`. Empty = unbound (players can bind it in their settings). |
| `UseLocations`      | If `false`, the marketplace can only be opened with the command or keybind.                                    |
| `InteractionRadius` | Distance at which a location's prompt works.                                                                   |
| `Locations`         | Access points: `coords`, `label` and `blip` (`sprite`, `color`, `scale`).                                      |

## Listing rules

| Option                       |   Default | Description                             |
| ---------------------------- | --------: | --------------------------------------- |
| `MinSalePrice`               |     `100` | Lowest sale price.                      |
| `MaxSalePrice`               | `5000000` | Highest sale price.                     |
| `MinRentalPrice`             |      `10` | Lowest rental price.                    |
| `MaxRentalPrice`             |  `500000` | Highest rental price.                   |
| `MaxActiveListingsPerPlayer` |       `5` | Active listings allowed per player.     |
| `TitleMaxLength`             |      `40` | Title length in characters.             |
| `DescriptionMaxLength`       |     `200` | Description length in characters.       |
| `PageSize`                   |      `24` | Listings per marketplace page (max 48). |

`Config.Categories` lists the selectable categories: `sedan`, `suv`, `sport`, `sportclassic`, `super`, `muscle`, `coupe`, `compact`, `motorcycle`, `offroad`, `truck`, `van`, `emergency`, `other`.

## Test drive

| Option                 | Default                                | Description                                                                    |
| ---------------------- | -------------------------------------- | ------------------------------------------------------------------------------ |
| `Enabled`              | `true`                                 | Turns test drives on or off.                                                   |
| `Duration`             | `60`                                   | Test drive length in seconds.                                                  |
| `ReturnVehicle`        | `true`                                 | Teleports the player back when it ends. The car is always deleted server-side. |
| `MaxDistanceFromSpawn` | `1500.0`                               | Ends the test drive automatically if the driver goes this far.                 |
| `SpawnLocation`        | `vector4(-378.0, -132.0, 38.68, 70.0)` | Main spawn point.                                                              |
| `SpawnLocations`       | `{}`                                   | Extra spawn points, used when `SpawnLocation` is occupied.                     |
| `Cooldown`             | `30`                                   | Seconds between a player's test drives.                                        |
| `RequireNearLocation`  | `false`                                | Only allow starting a test drive near one of `Config.Locations`.               |

## Photos

| Option                                  | Default                                             | Description                                                                                             |
| --------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| `Enabled`                               | `'auto'`                                            | On when `screenshot-basic` is running. Use `true` or `false` to force it.                               |
| `Required`                              | `'auto'`                                            | Photos are required whenever they're enabled. Use `true` or `false` to force it.                        |
| `MinPhotos` / `MaxPhotos`               | `1` / `5`                                           | Photos per listing.                                                                                     |
| `Storage`                               | `'auto'`                                            | `'fivemanage'` when the Fivemanage key convar is set, otherwise `'resource'` (saved in `web/uploads/`). |
| `Quality`                               | `0.65`                                              | Image quality from 0 to 1.                                                                              |
| `Resolution`                            | `1280 × 720`                                        | Capture resolution.                                                                                     |
| `SpawnLocation`                         | `vector4(-402.6151, 1230.0930, 325.6414, 170.6048)` | Photo booth scene. Keep it clear of the test drive spawn.                                               |
| `OrbitDistance`                         | `5.5`                                               | Default camera distance.                                                                                |
| `MinOrbitDistance` / `MaxOrbitDistance` | `2.0` / `12.0`                                      | Camera zoom limits.                                                                                     |
| `HidePlayerPed`                         | `true`                                              | Hides the player model so shots only show the vehicle.                                                  |
| `HideHud`                               | `true`                                              | Hides the HUD during capture.                                                                           |
| `RequireNearLocation`                   | `false`                                             | Only allow the photo booth near one of `Config.Locations`.                                              |

{% hint style="warning" %}
Keep the `web/uploads/` folder. Photos saved with `Storage = 'resource'` are stored there.
{% endhint %}

## Rentals

| Option                    | Default                             | Description                                                                                                             |
| ------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `Enabled`                 | `true`                              | Turns rentals on or off.                                                                                                |
| `MinHours` / `MaxHours`   | `1` / `720`                         | Rental length limits (720 h = 30 days).                                                                                 |
| `Units`                   | hour, day, week, month              | Rental units. A rental always lasts a whole number of units, never less than one. Unit keys can be up to 16 characters. |
| `Presets`                 | `{1, 6, 12, 24, 72, 168, 336, 720}` | Quick-select hour presets. Only presets that fit the listing's unit are shown.                                          |
| `ExpirationCheckInterval` | `60000`                             | Milliseconds between server-side expiration checks.                                                                     |
| `GracePeriodMinutes`      | `0`                                 | Extra minutes after expiry before the vehicle is taken back.                                                            |

```lua
Units = {
    { key = 'hour',  label = 'Hour(s)',  hours = 1 },
    { key = 'day',   label = 'Day(s)',   hours = 24 },
    { key = 'week',  label = 'Week(s)',  hours = 168 },
    { key = 'month', label = 'Month(s)', hours = 720 },
},
```

## Payment & fees

| Option                         | Default  | Description                                                              |
| ------------------------------ | -------- | ------------------------------------------------------------------------ |
| `Payment.Bank`                 | `true`   | Allow bank payments.                                                     |
| `Payment.Cash`                 | `true`   | Allow cash payments.                                                     |
| `Payment.DefaultMethod`        | `'bank'` | Preselected method.                                                      |
| `Payment.BankAccount`          | `'auto'` | Framework account name for bank.                                         |
| `Payment.CashAccount`          | `'auto'` | Framework account name for cash (`money` on ESX, `cash` on QBCore/Qbox). |
| `Config.TransactionFeePercent` | `2.5`    | Percentage fee on every sale or rental. `0` turns it off.                |

## Marketplace owner

```lua
Config.MarketplaceOwner = {
    Enabled = 'auto',
    Identifiers = {
        -- 'license:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    },
}
```

Players listed here can claim the transaction fees from the **Fees** tab. Accepted formats: `license:xxxx`, the bare license hash, or an ESX identifier (`char1:xxxx`). This is separate from `Config.Admin`.

## Garage integration

| Option             | Default  | Description                                                                                                                                                              |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Resource`         | `'auto'` | Override: `'okokgarage'`, `'qb-garages'`, `'esx_garage'`, `'custom'`, `'none'`.                                                                                          |
| `Enabled`          | `true`   | `false` = never change a vehicle's garage, and hide the delivery garage picker.                                                                                          |
| `DefaultGarage`    | `'auto'` | Used when the buyer doesn't pick a garage, and for returned rentals. Override with a garage name, for example `'pillboxgarage'`.                                         |
| `AvailableGarages` | `'auto'` | Garages a buyer can pick for delivery. Set `{}` to always use `DefaultGarage` with no picker, or set a list: `{ { name = 'pillboxgarage', label = 'Pillbox Garage' } }`. |

See [Garage & Key Integrations](/docs/jobs-and-economy/p2p-vehicle-marketplace/integrations.md).

## Vehicle keys integration

| Option     | Default  | Description                                                                                                                                                 |
| ---------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Resource` | `'auto'` | Override: `'default'`, `'qbkeys'`, `'qbx_vehiclekeys'`, `'wasabi_carlock'`, `'qs-vehiclekeys'`, `'MrNewbVehicleKeys'`, `'Renewed-Vehiclekeys'`, `'custom'`. |
| `Enabled`  | `true`   | `false` = never give or remove keys.                                                                                                                        |
| `LockKey`  | `''`     | **Built-in keys only.** Default key for locking a rented vehicle. Empty = unbound.                                                                          |

## Admin

```lua
Config.Admin = {
    Group = 'admin',
    Ace = 'command.marketplaceadmin',
}
```

See [Usage & Permissions](/docs/jobs-and-economy/p2p-vehicle-marketplace/usage-and-permissions.md#permissions).

## Discord logging

| Option                   | Default         | Description                                                  |
| ------------------------ | --------------- | ------------------------------------------------------------ |
| `Enabled`                | `'auto'`        | On when the `ace_marketplace_discord_webhook` convar is set. |
| `Username`               | `'Marketplace'` | Webhook display name.                                        |
| `AvatarURL`              | `''`            | Webhook avatar.                                              |
| `Events.ListingCreated`  | `true`          | Log new listings.                                            |
| `Events.Purchase`        | `true`          | Log purchases.                                               |
| `Events.Rental`          | `true`          | Log rentals.                                                 |
| `Events.EarningsClaimed` | `true`          | Log earnings claims.                                         |

## Vehicle table columns (advanced)

Only change these if your server renamed the standard columns. Extra columns such as `parking`, `pound`, `in_garage`, `garage_id` and `depotprice` are detected automatically.

{% tabs %}
{% tab title="ESX (owned\_vehicles)" %}

```lua
Config.ESXVehicleTable = {
    Table = 'owned_vehicles',
    Owner = 'owner',
    Plate = 'plate',
    Props = 'vehicle',      -- JSON column; also holds the numeric model hash (props.model)
    StoredColumn = 'stored',
    StoredValue = 1,        -- value that means "garaged / available" (0 is commonly "out")
    Garage = 'garage',
}
```

{% endtab %}

{% tab title="QBCore / Qbox (player\_vehicles)" %}

```lua
Config.QBVehicleTable = {
    Table = 'player_vehicles',
    Owner = 'citizenid',
    License = 'license',    -- kept in sync with Owner on transfer
    Plate = 'plate',
    Model = 'vehicle',      -- spawn name string
    Props = 'mods',
    StoredColumn = 'state',
    StoredValue = 1,        -- 0 = out, 2 = impounded
    Garage = 'garage',
}
```

{% endtab %}
{% endtabs %}

## Server-only secrets

Set these in `server.cfg` with **`set`**, never `setr`:

| Convar                            | Purpose                               |
| --------------------------------- | ------------------------------------- |
| `ace_marketplace_fivemanage_key`  | Fivemanage API key for photo storage. |
| `ace_marketplace_discord_webhook` | Discord webhook for logs.             |
| `ace_marketplace_debug`           | `true` turns on detailed logging.     |

{% hint style="warning" %}
If an older `config.lua` still contains `FivemanageApiKey` or `WebhookURL`, the value is still used but the console shows an error. Move it to the convar and **generate a new key**, because players could already read the old one.
{% endhint %}

## Locales

Player-facing strings are in `locales/<lang>.lua` (`en`, `de`, `es`, `fr`, `pt`, `ar`). Edit them freely, and keep your edits when you update.
