> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexdev.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Dealership lots

> Each dealership lot is a Lua entry in shared/locations.lua. This file is escrow_ignore'd so you can move peds and add lots without re-uploading the asset.

Each dealership lot is a Lua entry in `shared/locations.lua`. This file is `escrow_ignore`'d so you can move peds and add lots without re-uploading the asset.

## Anatomy of an entry

```lua theme={null}
Config.Dealerships = {
    ['pdm'] = {
        Coordinates     = vector3(-33.0972, -1097.5510, 27.2744),
        PedCoordinates  = vector4(-33.33413, -1103.742, 25.422317, 71.312294),
        PreviewCoords   = vector4(14.82224, -1070.967, 37.743404, 340.14855),
        PurchaseCoords  = vector4(-13.68, -1092.31, 26.67, 159.82),
        TestCoordinates = vector4(-46.7695, -1076.0365, 27.0419, 67.3260),
        Ped             = 's_m_m_autoshop_01',
        Blip            = { Name = 'PDM Dealership', Sprite = 326, Colour = 2, Scale = 0.6 },
        Categories      = { 'sedans', 'compacts', 'sports', 'motorcycles', 'super' },
    },
}
```

Only the marked **required** fields below have to be present — everything else falls back to defaults.

| Field             | Required | What it does                                                                                                                                                        |
| ----------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Coordinates`     |    yes   | The world point used to anchor the blip and proximity checks.                                                                                                       |
| `PedCoordinates`  |    yes   | Where the salesperson stands (or where the ground marker is drawn if `Interaction = 'marker'`).                                                                     |
| `PreviewCoords`   |    yes   | Where the camera and selected vehicle are placed during browsing. Pick somewhere private to avoid players walking through the showroom.                             |
| `PurchaseCoords`  |    yes   | Where the newly-bought vehicle spawns.                                                                                                                              |
| `TestCoordinates` |    yes   | Where the test-drive vehicle spawns.                                                                                                                                |
| `Categories`      |    yes   | Array of catalog categories this lot sells (`'sedans'`, `'super'`, `'boats'`, `'planes'`, `'helicopters'`, `'cycles'`, `'motorcycles'`, etc.).                      |
| `Ped`             |    no    | Salesperson model. Only used when `Interaction = 'ped'`. Defaults to `s_m_m_autoshop_01`.                                                                           |
| `Blip`            |    no    | `{ Name, Sprite, Colour, Scale, Active }` — any field overrides `Config.Blip`. Set `Active = false` to hide.                                                        |
| `Interaction`     |    no    | `'ped'` (default) or `'marker'`. Marker draws a chevron at `PedCoordinates` styled by `Config.Marker`.                                                              |
| `Job`             |    no    | Restrict who can BUY here. String (`'cardealer'`) or list (`{ 'pd', 'sheriff' }`).                                                                                  |
| `Grade`           |    no    | Minimum job grade if `Job` is set.                                                                                                                                  |
| `Owner`           |    no    | Marks this lot as **player-owned**. String job name, or `{ jobName, minGrade }`. Members of that job (or admins with the management ace) can run `/dealershipmgmt`. |
| `Society`         |    no    | Society/job account name (used with `Config.Purchase.SocietyPayout`).                                                                                               |
| `RequiredItem`    |    no    | Inventory item the player must hold to interact (e.g. `'dealership_card'`).                                                                                         |
| `DisplayVehicles` |    no    | Array of preset display cars: `{ { model='sultan', coords=vector4(...), colour={27,27} } }`. You can also add these in-game from the management dashboard.          |

## Adding a new lot

1. Open `shared/locations.lua`.
2. Copy one of the existing entries.
3. Change the key (`['pdm']`) to something unique — this is the **dealership key** used everywhere internally.
4. Set new coordinates and ped.
5. Tick the categories you want to sell.
6. Save and restart `nex_dealerships`.

The blip appears immediately. If the lot is empty when players browse it, that's a category-mismatch — the catalog has no vehicles in the categories you listed.

## Ped or marker?

Default behaviour spawns the salesperson at `PedCoordinates`. Players walk up and either eye-target them (target mode) or get an `[E] Browse Vehicles` hint (textui mode).

Prefer a marker over a person? Add `Interaction = 'marker'` to the entry and the resource will draw an upward chevron at `PedCoordinates`. Tweak the marker style (type, scale, colour, range) in `Config.Marker` — see [Configuration](/nex_dealerships/configuration#marker-when-a-lot-uses-interaction-marker).

## Public vs. owned

* **Public lot** — omit `Owner`. Anyone can buy here. Sales feed the configured society / dealership balance directly, with no owner split. These lots don't show up in `/dealershipmgmt`.

* **Owned lot** — set `Owner = 'jobName'` (or `{ 'jobName', minGrade }`). Players with that job see the lot in `/dealershipmgmt` and can manage stock, staff, display vehicles, settings, and view sales. Set a real owner via `/dealershipadmin` → **Dealerships** tab → **Set Owner**, and `Config.Purchase.OwnerSplitPercent` of every sale goes to that owner; the rest goes to the dealership balance.

<Info>
  Admins holding `Config.Management.AcePermission` can open the dashboard for **any** owned lot — they don't need the job. Use this to seed a new dealership before handing it off to a player.
</Info>

## Job-restricted buying

Set `Job` (and optionally `Grade`) to lock who can buy from a lot — handy for police, EMS, or staff fleet lots.

```lua theme={null}
['police_fleet'] = {
    Job        = { 'police', 'sheriff' },
    Grade      = 2,
    Categories = { 'emergency', 'service' },
    -- coords, blip, etc.
}
```

`Job` here only restricts **buying** — it has nothing to do with `Owner`. A lot can be public-buy but owned by a job (`Owner = 'cardealer'` without `Job`), or job-buy without an owner.

## Required-item gate

Want a key card or dealership pass to be required for browsing?

```lua theme={null}
RequiredItem = 'dealership_card',
```

The item is checked client-side at interaction time and the lot is skipped silently if the player doesn't have it.

## Display vehicles

Two ways to put cars on the showroom floor:

1. **Hard-coded** — add a `DisplayVehicles` array to the lot entry in `shared/locations.lua`.
2. **In-game** — open `/dealershipmgmt` → **Display Vehicles** tab, click **Place vehicle**, walk into position, and drop. Stored in the database, syncs to all clients without a restart.

The in-game option is easier and survives updates — see [Management dashboard](/nex_dealerships/management#display-vehicles).
