> For the complete documentation index, see [llms.txt](https://docs.jgscripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jgscripts.com/dealerships/changelog/v1.1.md).

# v1.1

## Changelog

* Dealerships can hire employees
* Employees can sell vehicles directly to customers; showroom can be disabled
* Sell vehicle back to the dealership
* Optional markers so dealership locations are easier to find
* Hide blips (set `hideBlip = true`) within the dealership config
* Restrict access to Dealership based on job or gang
* Open callback on client & server for restricting showroom access
* "Restore showroom" button for resetting display vehicles if they get messed up
* Vehicle sales now show name in Dealership Management
* Toggle financing per dealership
* Set new vehicle plate patterns + fix bug where plate would exist in DB
* Fix: okokTextUI spamming sound (fixed text ui being constantly re-rendered)
* Fix: Health being restored when exiting the dealership/ending test drive
* Fix: SQL error when updating a vehicle in /dealeradmin
* Fix: Colour changing after vehicle purchase
* Fix: Financing bugs

## Upgrade Instructions

1. Replace **all** files
2. Run the following SQL code in your database (works for both QB & ESX):

```sql
ALTER TABLE `dealership_data` ADD IF NOT EXISTS `employee_commission` INT NOT NULL DEFAULT '10';

CREATE TABLE IF NOT EXISTS `dealership_employees` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `identifier` varchar(255) NOT NULL,
  `dealership` varchar(255) NOT NULL,
  `role` varchar(100) NOT NULL,
  `joined` datetime NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `fk_employees_dealership` (`dealership`),
  CONSTRAINT `fk_employees_dealership` FOREIGN KEY (`dealership`) REFERENCES `dealership_data` (`name`)
);
```

## New Chat Command

All dealership employees (any rank) get access to the new `/directsale` chat command. This brings up a menu and shows a tablet emote in-game, allowing the employee to sell a vehicle directly to a nearby player. The nearby player will have to approve and sign to finalise the purchase.

This will only work if they are (1) employed by that dealership (2) close enough to the "showroom" coords location. The radius can be configured via `directSaleDistance` within the dealership location within `config.lua`

## Config File Changes

You should probably use the Configurator: <https://configurator.jgscripts.com>

<pre class="language-lua"><code class="lang-lua">Config.PlateFormat = "1AA111AA" -- 1 = number, A = letter (max 8 characters)
<strong>Config.SellVehiclePrompt = "[E] Sell Vehicle"
</strong>Config.SellVehicleKeyBind = 38
Config.EnableSellVehicle = true -- Vehicles are sold back to the dealerships - they must pay for the vehicle but receive the vehicle as stock
Config.SellVehiclePercent = 0.6 -- 60% of current sale price
</code></pre>

#### New Config Options within Dealership:

```lua
    sellVehicle = vector3(-27.89, -1082.1, 26.64), -- sell vehicle location
    enableFinance = true,
    hideMarkers = false,
    markers = { id = 21, size = { x = 0.3, y = 0.3, z = 0.3 }, color = { r = 255, g = 255, b = 255, a = 120 }, bobUpAndDown = 0, faceCamera = 0, rotate = 1, drawOnEnts = 0 },
    showroomJobWhitelist = {}, -- format: showroomJobWhitelist = { mechanic = {1, 2, 3} }
    showroomGangWhitelist = {}, -- (QB only) format: showroomGangWhitelist = { lostmc = {1, 2, 3} }
    disableShowroomPurchase = false, -- if you want to use /directsale only
    directSaleDistance = 50, -- how far away employees can use /directsale
    job = "cardealer", -- Owned dealerships only; job employees get within QB/ESX
```

## Employees

You can now hire employees via the Dealership Management > Employees tab.

Employees can be one of three ranks: Manager, Supervisor or Sales. You cannot change this, but you can configure how this aligns to ranks for the job in your framework via `framework/sv-functions.lua`

Here is the permissions breakdown:

<figure><img src="/files/Ijwdg9MJSDdsDlaUnLFN" alt=""><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.jgscripts.com/dealerships/changelog/v1.1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
