Studios
Mechanic Menuhouse-3.jpg

Commands & Exports

SoonMechanic MenuQbox
PAGE 06 OF 07  ·  TROUBLESHOOTING → COMMANDS & EXPORTS → SESSIONS & SECURITYdocs.glitchstudios.dev
Browse docs

Commands#

Command Who What
/glitchmechanic Config.Restricted Opens the customiser for the car you are in. The name comes from Config.Command.

Client exports#

Export Returns What it does
OpenOrder(opts) boolean Opens order mode on the car the player sits in. Options: tabs, shop, event, data, hide, addons, neonRgb, locks, build. Send order fires TriggerEvent(event, build, hex, data) on the same client.
OpenLimited(opts) boolean Opens workshop mode. Options: vehicle, title, allow, and for paid workshops prices, share, payer, payCallback. Returns false when allow holds no known part.
IsOpen() boolean true while the menu is open.

Server exports#

Export Returns What it does
GetSessionBill(source) string[] or nil Sorted list of the parts the server sees changed in that player's open paid workshop session.
ConfirmSessionPaid(source) boolean Marks that player's paid workshop session as paid. Returns false when none is open.
AllowSession(source, netId, mode, parts) boolean Lets that player open one 'order', 'limited' or 'paid' session on that car in the next 30 seconds. parts limits the workshop parts, nil allows any. Only used with Config.RequireSessionGrant.

Events#

Event Side What it does
glitch-mechanicMenu:open Client (net) Opens the admin menu for that player: TriggerClientEvent('glitch-mechanicMenu:open', src).

Pay callback contract#

Your payCallback is an ox_lib server callback, called as payCallback(parts, method, plate). parts is a list such as { 'paint', 'tint' } and method is 'cash' or 'bank'. Return ok, message. The parts stay on the car when ok is true and, with Config.RequirePaidConfirm, after ConfirmSessionPaid(source).

The resource's own glitch-mechanicMenu:begin, :bill, :req, :photos callbacks and the glitch-mechanicMenu:finish event serve the menu itself. They are not an integration API.