Commands#
Dealership Creator registers two in-game commands and a set of console commands. The in-game ones respect permissions; the console ones exist to explain what the script is thinking, and to fix things when you cannot get into the game.
Command | Where | Description |
|---|---|---|
| In game | Opens the player's window: the dealerships a player owns or works at, their finance plans and preferences. Bound to |
| In game | Opens the creator's window. Admins only — anybody else sees the access screen with their identifier and the line to grant it. The name is |
| Console | Whether player |
| Console | Which of the nine shop rights that player holds at that dealership, and why. |
| Console | Walks every gate between a player and a showroom — enabled, allowed, open, stocked, close enough — and names the one that shut. |
| Console | Every dealership: what the database holds, what the cache holds, and what a client receives. |
| Console | Per dealership, why a buyback selling spot does or does not appear. |
| Client console (F8) | What this client believes about every dealership's counter — where it is, what kind, and whether it was registered. |
| Console | Re-reads settings, dealerships or both from the database without a restart. |
| Console | Sends a test embed to every Discord channel in Config.Webhooks that has a URL, and says which ones Discord accepted. |
| Console | Drops every Dealership Creator table and rebuilds them with the starter content. |
dbresetdeletes every dealership, sale, staff member and setting belonging to Dealership Creator, and there is no undo. It refuses to run from in game, without the wordconfirm, and unless debug is on — setConfig.Debug = true, or start the server with the convarqs-dealership:debug 1. Use it on a test server.
<id> is the player's server id — the number next to their name in the player list.
Client Exports#
For opening the interface or a showroom from your own scripts — a laptop prop, a radial menu, a phone app — and for asking about a vehicle.
Opening and closing the interface
exports['qs-dealership']:OpenUi() -- the player's window
exports['qs-dealership']:OpenUi('admin') -- the creator's window
exports['qs-dealership']:CloseUi()
exports['qs-dealership']:ToggleUi()
local open = exports['qs-dealership']:IsUiOpen()
-- Open on a given section, e.g. one shop's sales desk
exports['qs-dealership']:Navigate('manage', '3:sales')Showrooms
exports['qs-dealership']:OpenDealership(dealershipId) -- walk the player into a showroom
exports['qs-dealership']:CloseDealership()
local browsing = exports['qs-dealership']:IsBrowsing()
local list = exports['qs-dealership']:GetDealerships()Is this a temporary vehicle?
Call it from a garage, a tuning shop or a chop shop to refuse restock and test-drive cars.
exports['qs-dealership']:IsTemporaryVehicle(vehicle) -- restock run OR test drive
exports['qs-dealership']:IsMissionVehicle(vehicle) -- restock runs only
exports['qs-dealership']:IsTestDriveVehicle(vehicle) -- test drives onlyEach reads a replicated state bag, so it answers correctly for a car somebody else is driving, and keeps answering if the resource is restarted.
Notifications and player data
exports['qs-dealership']:Notify({
type = 'success', -- success · error · warning · info
title = 'Deal closed',
description = 'The Adder is yours.',
duration = 5000,
})
local player = exports['qs-dealership']:GetPlayerData()Furniture
-- Add a piece to a category of the furnishing catalogue from another resource
exports['qs-dealership']:AddFurniture('chair', {
label = 'Leather bench',
object = 'prop_bench_01a',
price = 450,
})
local decorating = exports['qs-dealership']:inDecorate()Server Exports#
How another resource drives Dealership Creator — a reward car, a heist that steals stock, a job script that checks who works where.
GiveVehicle
Registers a vehicle to a player through whichever framework is installed — the same bridge a purchase uses, so it lands in the same garage a bought car does.
local plate = exports['qs-dealership']:GiveVehicle(source, {
model = 'adder',
plate = 'WINNER01', -- optional, generated from the plate format if omitted
props = {}, -- optional vehicle properties
garage = 'pillboxgarage', -- optional, defaults to the Default garage setting
})
-- returns the plate, or falseDealerships and stock
local all = exports['qs-dealership']:GetDealerships()
local shop = exports['qs-dealership']:GetDealership(3)
local stock = exports['qs-dealership']:GetStock(3)
-- Move a stock level: a heist that steals one, an event that hands one over.
-- Returns false when the shop does not sell it or the level would go out of range.
exports['qs-dealership']:MoveStock(3, 'adder', -1)Staff and permissions
local staff = exports['qs-dealership']:IsDealershipStaff(source, 3)
local mask = exports['qs-dealership']:GetStoreMask(source, 3) -- the shop rights as a bitmask
local admin = exports['qs-dealership']:IsAdmin(source)
local can = exports['qs-dealership']:PlayerHasPermission(source, 'dealership.catalog')
local ok = exports['qs-dealership']:HasPermission(mask, 'store.sell')
local names = exports['qs-dealership']:DecodePermissions(mask, 'store') -- { 'sell', 'stock', ... }RegisterPermissions, PermissionNamespaces and PermissionMask expose the same bit layout to another resource, so it can share it rather than invent a second one.
Settings and the framework
local tax = exports['qs-dealership']:GetSetting('dealership.taxPercent', 0)
local framework = exports['qs-dealership']:GetFramework()
exports['qs-dealership']:Notify(source, { type = 'info', title = 'Your order arrived' })About the Errors#
Every callback that can refuse returns a locale key, not a sentence: error.no_permission, error.outside_zone, error.dealership_no_funds. That is deliberate — the same failure reads in each player's own language, in all five of them. Log the key in your own scripts, and translate it with the strings in locales/.



