Dealerships
Qbox dealership resource using the GR1M dealership UI. It replaces jg-dealerships completely: shop, staff, stock, finance, trade-ins, private sales and swaps, test drives and the Motors phone app.
#Runtime dependencies
Required and started before this resource:
qbx_core,qbx_vehiclesox_lib,oxmysql,ox_targetGR1M_UltraBossfor dealership jobs, employee management, payroll grades, and society accounts
Optional integrations:
GR1M_Mechfor the free services that come with every retail sale (server/warranty_dealership.luain GR1M_Mech)GR1M_Carkeysfor keys on delivery, test drives and transferslb-phonefor the Motors custom appGR1MOS_Phoneread-only dealership provider
GR1M_UltraBoss bank and phone apps read loans from this resource (GetFinanceAccounts, PayFinanceInstallment), with jg-dealerships as a fallback when this resource is stopped.
#Install
- Back up the database. On first start the resource creates or upgrades its own tables (schema v7). The database user needs
CREATE,ALTER,INDEX,SELECT,INSERT,UPDATEandDELETE. If installation fails, dealership actions stay disabled and the console says why. - In the server cfg, after
GR1M_UltraBossandGR1M_Mech:stop jg-dealershipsthenensure GR1M_Dealerships. - Grant the admin ACE
dealership.admin(or use a Qboxadmin/godgroup). Creating a dealership also needs UltraBoss admin rights, because UltraBoss creates the job. - Import the JG data (see Legacy cutover), or run
/dealeradminto create dealerships and capture their points.
#Commands
/dealershipopens the showroom of the nearest open dealership. Staff with sell rights at that dealership get the sales floor view instead (sell to a nearby customer, with a discount up to their rank's ceiling)./dealercontract p2p(private sale, seller sits in the car) or/dealercontract p2d(dealer acquisition at the trade-in bay)./dealertradefor a signed multi-vehicle and cash swap./dealeradminfor the admin menu.- Target zones at each dealership open the showroom, the management tablet and the stock unload bay.
#How it works
- Sales. Self-service purchases follow the kiosk switch and showroom hours. Assisted sales (grade 1+) send the customer an offer to accept; the salesperson earns
Config.Sales.commissionPercentfrom society funds and can discount up toConfig.Sales.discountByGrade, never below what the dealership paid. Bought cars are spawned by the server at the delivery point with keys. - Free services. Every retail sale gives the buyer
Config.Sales.warranty.freeServicesfree GR1M_Mech services. The selling dealership's society pays the mechanic shop the normal price. A full service counts as one. - Finance. Weekly instalments come out of the buyer's bank whether they are online or not. Only a short balance (or no record) counts as missed; server problems are retried. After
repoAftermissed payments the loan defaults, and afterConfig.Finance.repoGraceDaysdays in default the car is repossessed automatically (taken off the street or out of the garage and put on the lot). Managers can repossess a defaulted loan straight away from the tablet. Buyers can pay early or pay off from the Motors app. - Test drives. One per player, spawned and removed by the server. The owner's deposit setting is taken from the bank and returned if the car comes back undamaged; parking at the lot and stepping out ends it early. Disconnects and restarts clean up and refund.
- Trade-ins and private sales. A car with an active loan can't be sold or traded. Ownership is re-checked after the other party accepts. Traded-in cars are removed from the world and the seller loses their keys. Appraisal uses the car's current condition.
- Staff. Whether staff may trade in their own car to their own dealership is a Global rules toggle in
/dealeradmin(off by default). Hire, promote, demote and fire only work on people who work at the dealership and rank below you. Permissions come fromConfig.Permissions. - Exchange. Stock bought from another dealership is priced at the purchase price plus the buyer's markup. New-only lots can't buy used cars and vice versa.
- Self-service lots. An admin sets a dealership to Self-service in
/dealeradmin(Dealership file, Lot mode and access). Every catalogue car is always in stock and sold at list price with no staff. Players can drive onto the trade-in bay and press E to sell their own car for the sell-back share of list price, scaled by condition (the car is scrapped and paid by the city). Income leaves the economy unlessConfig.SelfService.creditSociety = true. jg-dealerships'self-servicelocations import as this mode. - Job-only lots. The same panel takes a job whitelist (e.g.
police, ambulance). Only those jobs (main or second job) can browse and buy there. Emergency classes inConfig.RestrictedClassesonly appear at whitelisted lots. - Paint. New cars can be bought in any colour from
Config.Colours; the turntable car shows it. - Showroom. Browsing only works at a showroom or kiosk point and never while downed or cuffed. Logging out mid-browse saves the spot you came from.
- Garage and flags. Bought cars are marked out (or parked at
Config.Garage.defaultGarageif they can't be delivered) in GR1M_Garage's columns.paid_priceis set, andplayer_vehicles.financed/finance_datafollow this resource's loans so UltraBoss trade credit stays right. Up toConfig.Finance.maxLoans(3) loans per player. - Prices. The admin price per dealership and model (Vehicle catalog) is the minimum. Owners (pricing permission) set their own retail per model in the tablet Inventory; it applies to every unit on the lot and future deliveries and can't go under the minimum. Owners buy new stock at the Global rules "Owners pay for new stock" share of the minimum (80% by default) plus the supplier's markup, so the gap is their profit.
- Trade-in at checkout. A buyer can trade in a car parked at the lot. Its value comes off the price; if it's worth more, the difference goes to their bank (from the society at a staffed lot, from the city at a self-service lot). Staffed lots with a used lot keep it as used stock at the credited value; new-only lots take no trade-ins.
- Stock orders. Owners and managers order from Port or Rail (pickup run) or Freight (delivered after
Config.Stock.deliveryMinutes). A pickup run starts from the tablet at the unload bay: a hauler spawns, the driver loads the order at the supplier (a car-carrier trailer spawns there), hooks it up and unloads at the bay. One run per player; disconnect, timeout or/dealerrun cancelputs the order back. Waiting orders can be cancelled for a 90% refund. - Display cars and salesperson. Admins (any lot) and owners (their lot) place frozen display cars and a salesperson NPC with aim-to-place. Players browse the showroom from any of them.
- Kiosks. Admins link map kiosk props in
/dealeradmin> Kiosks: aim at the kiosk, then place its display spot with GR1M_Placer. Players browse from a linked kiosk (third-eye or E) without being moved: the picked car appears on that kiosk's display spot for everyone, the same way show cars work: the server keeps the model and paint per kiosk and each client near the spot draws its own frozen, locked copy. One customer per kiosk. The last car looked at stays on the spot after they close the menu (kept across restarts) until the next customer picks another. A see-through car shows the spot while an admin places it. Paint, zoom and the interior view work there too. Test drives and bought cars come out at the dealership's usual test drive and delivery spots; after a test drive started at a kiosk the player is put back where they stood at that kiosk. Kiosk prop models and ranges are inConfig.Kiosks. - Fleet purchases. Lot mode takes a list of jobs or gangs; their bosses can pay with the group's society money and the car becomes a job or gang vehicle in that group's GR1M_Garage.
- Custom plates. At checkout a buyer of a new car can type their own plate (2-8 letters, numbers or spaces). It is checked live against every plate on file and fitted GR1M_FakeID plates, costs the City settings fee (paid up front to the dealership, never financed) and goes on the car, keys and garage record. City settings > Sales turns it on or off and sets the fee.
- Vehicle requests. Customers press "Request a vehicle" in the showroom (or "Request this car" on a sold-out car) with an optional budget and note; up to 3 open requests per dealership. Online staff get a notice, it posts to the Discord webhook (or the separate requests webhook in City settings > Discord), and the tablet Requests page lists them with the customer's phone. Staff mark them Ordered, Ready or Declined (or jump to Order stock) and the customer is told in game.
- Coupons and payment methods. Owners create coupon codes (percent or amount, use limit, expiry) and choose whether cash and bank are accepted.
- Interior view and Discord. The showroom has an interior camera. Discord (City settings): the public webhook only posts new vehicle requests and "ready for purchase" (car, dealership, who asked; no prices). Sales, repos, orders and staff changes go only to the optional staff-only webhook.
- Tow-in repossessions. Admins place repo spots in City settings > Repossessions. With at least one spot, Repossess on a defaulted loan takes the car from the buyer and parks it, locked, at a random spot with a map marker for the dealer. They tow it with their own tow truck to the unload bay and press E to put it in pre-owned stock. If it is not back within the time limit (or the dealer leaves, or the car is lost) it goes onto the lot anyway;
/dealerrepo lotsends it there straight away. Automatic repossessions after the grace period skip the tow. - Pickup points and E prompts. Admins add, name, price (supplier markup) and place pickup points by aiming in City settings > Pickup points; dealers choose one per order. Points can be used with third-eye, E, or both (City settings > Interaction), with the E range per point.
- Markers. Every dealership point (showroom, kiosk, management desk, unload bay, trade-in bay, test drive, delivery) and the supplier stop during runs can show a marker. City settings > Markers sets, per point, who sees it (everyone, staff, off), marker type, size, height, colour, opacity, bob, spin and draw distance; saving updates every client at once.
- City settings.
/dealeradmin> City settings edits everything below without touching files: supplier pickup spots (aim-to-place with heading), truck and trailer, run time limit, load/unload radius, freight time, cancel refund, exchange cap, loans per player, repossession days, coupon cap, browse distance, fallback garage, restricted classes, self-service sell-back and income, display car limits, salesperson animation, paint palette and the Discord webhook.config.luaonly holds the starting values; Reset puts one back. - Catalogue manager. /dealeradmin > Vehicle catalog: pick a dealership, search and filter by class/status, select cars and enable/disable, set the minimum price, move or copy them to another dealership, or remove them (they return to the unassigned pool with their price remembered). The pool and All cars views add cars to a dealership, and All cars can also move a car here and off every other lot. Assignment is per car, so cars of one class can be split between lots. Dealership file > Categories sets a lot's classes as a starting point: a newly ticked class adds its cars no dealership sells yet, and saving never puts back a car you took off or gave to another lot. Removing a dealership moves its stock and loans to another lot (or clears stock), takes staff off the job, refunds waiting orders and frees the job name.
- Catalogue. Admins can add a qbx_core vehicle to a dealer or resync all vehicles of its classes from the Vehicle catalog screen. Other resources read prices with
exports.GR1M_Dealerships:GetVehiclePrice(modelOrHash, dealershipId?).
#Safety notes
- Prices, stock, identity, proximity, grades, money and ownership are checked on the server. NUI data is presentation only.
- Bank balances and society accounts are checked before every debit; neither Qbox nor UltraBoss stops them going negative on their own.
- Dealership removal is blocked until employees, stock, open orders, loans and society balance are cleared; history is kept.
GR1M