JG Docs
Dealerships

Client API

openShowroom

Open the dealership showroom UI for a player.

exports['jg-dealerships']:openShowroom(dealershipId, defaultVehicle, defaultColor)
ParameterTypeRequiredDescription
dealershipIdstringYesDealership ID to open
defaultVehiclestringNoPre-select a vehicle by spawn code
defaultColornumber|tableNoPre-select a colour (paint index or {r, g, b})

exitShowroom

Close the showroom UI and clean up resources.

exports['jg-dealerships']:exitShowroom()

cancelTestDrive

Cancel the player's active showroom test drive without reopening the showroom. This removes the test-drive vehicle and keys, restores the player's return position and routing bucket, and releases NUI focus. Use this instead of exitShowroom while a test drive is active.

local cancelled = exports['jg-dealerships']:cancelTestDrive()

Returns true when an active test drive is cancelled, or false when there is no active test drive or cleanup is already running. Calling it again does not repeat cleanup.

Client integrations can also trigger the same cleanup with an event:

TriggerEvent('jg-dealerships:client:cancel-test-drive')

Native player death and supported framework dead/last-stand states cancel a showroom test drive automatically. Ambulance resources using a different death state can call this hook when the player dies. Direct-sale test drives use their own lifecycle and are not cancelled by this hook.

Last updated 21 September 2026

On this page