Commands#
Command | Who | What it does |
|---|---|---|
| Admin | Opens the creator: the shop list, the map, and every server setting. |
| Admin | Fully repairs the vehicle you are in. The name is the |
Documentation
Every command Mechanic Creator registers, and its exports: read and move a mechanic shop's balance, find the shop a job staffs, drive repairs and wheel damage, read wardrobes, invoice an engine swap, plus the Discord webhook system.
Command | Who | What it does |
|---|---|---|
| Admin | Opens the creator: the shop list, the map, and every server setting. |
| Admin | Fully repairs the vehicle you are in. The name is the |
| Server console | Puts one driving system back to its shipped defaults: |
The two keybinds are not commands but belong here anyway: the tablet is F6 and the mechanic radial is F5, both rebindable by the player under Settings → Key Bindings → FiveM.
For driving the mechanic jobs from your own scripts — a job script, a mission, a tow truck of your own.
Each one runs the same path the radial menu does, including the item requirement and the skill check, and each is written to the shop's service history.
exports['qs-mechanic-creator']:PerformFullRepair()
exports['qs-mechanic-creator']:PerformBodyRepair()
exports['qs-mechanic-creator']:PerformEngineRepair()
exports['qs-mechanic-creator']:WashVehicle()
exports['qs-mechanic-creator']:FlipVehicle()
exports['qs-mechanic-creator']:FuelVehicle()Useful if you would rather open it from your own menu than from a keybind.
exports['qs-mechanic-creator']:OpenRadialMenu()
exports['qs-mechanic-creator']:CloseRadialMenu()For a garage or vehicle-storage script that wants to round-trip the damage itself rather than let it reapply automatically — restoring it before anybody gets in, for instance.
-- Which wheels are currently broken off. Returns a list of wheel indices,
-- or an empty table when the vehicle has none.
local broken = exports['qs-mechanic-creator']:GetVehicleWheelDamage(vehicle)
-- Put the stored damage back on a vehicle that was just respawned.
exports['qs-mechanic-creator']:ApplyVehicleWheelDamage(vehicle)-- Clears the mud state from a vehicle's wheels.
exports['qs-mechanic-creator']:ForceResetVehicleWheels(vehicle)So a clothing or duty script can tell whether somebody is in work clothes, and keep their own outfit safe.
local atWork = exports['qs-mechanic-creator']:IsInWorkWear()
local civilian = exports['qs-mechanic-creator']:GetCivilianClothing()
exports['qs-mechanic-creator']:SetCivilianClothing(clothing)How another resource drives Mechanic Creator — a bank, a payroll script, a tax collector, or a billing flow of your own.
The money a shop holds. Read from the database rather than from a cache, so it is the figure a spend is actually measured against.
local balance = exports['qs-mechanic-creator']:GetMechanicBalance(mechanicId)
-- returns a number; 0 when there is no such shopPuts money into a shop's funds and records it in the shop's ledger as a deposit, where the tablet shows it as income.
-- mechanicId the shop the money goes to
-- amount a positive number; anything else is refused
-- reason optional, what the ledger will show
-- (defaults to your resource name, which is recorded either way)
local ok, balance = exports['qs-mechanic-creator']:AddMechanicBalance(
mechanicId, 5000, 'Weekly subsidy'
)
-- returns true and the resulting balance, or false when the shop does not existTakes money out of a shop's funds and records it as a withdrawal. The balance is never taken below zero, and the arithmetic happens in the database under a lock, so two callers in the same tick cannot overdraw it between them.
local paid, available = exports['qs-mechanic-creator']:RemoveMechanicBalance(
mechanicId, 2500, 'Business tax'
)
-- returns false when the shop cannot cover it, with what it does hold,
-- so you can say how short it is
if not paid then
print(('The shop only has %d'):format(available))
endThe shop a framework job or gang staffs, for a script that knows the job but not the shop. An owner outranks a job, the same rule the permission check applies, so a shop somebody bought stops answering to the job left on it — and the name is compared exactly, as that check compares it.
local mechanicId, all = exports['qs-mechanic-creator']:GetMechanicByJob('mechanic')
-- returns the shop id, or nil when no shop is staffed by that job.
-- A job with more than one shop answers with the first by id and hands you
-- the whole sorted list as a second value.Bills a customer for an engine through whichever billing resource you run, crediting the shop. Useful when the swap was arranged by your own script rather than at the laptop.
-- customerSource the player being billed
-- engineName what appears on the invoice
-- mechanicShopId the shop the money goes to
-- overrideAmount optional; omit to use the catalogue price
exports['qs-mechanic-creator']:SendEngineSwapInvoice(
customerSource, engineName, mechanicShopId, overrideAmount
)local outfits = exports['qs-mechanic-creator']:GetWardrobe(shopId)
local all = exports['qs-mechanic-creator']:GetAllWardrobes()These are what an inventory calls when a player uses one of the four items. You do not call them yourself — you name them in your inventory's item list, which Inventory Items covers in full.
Item | Server export | Client export |
|---|---|---|
|
|
|
| Same name as the item | Same name as the item |
A full logging system, configured in one file: server/custom/webhooks.lua. Ten categories covering more than thirty-five individual events, each toggleable on its own, with rate limiting so Discord does not throttle you.
Server Settings → Integrations → Webhooks. Make one per channel you want to split logs across, and copy each URL. One URL reused everywhere is fine too.
Webhooks.Enabled = true
Webhooks.Links = {
shop_management = "https://discord.com/api/webhooks/...",
employee_management = "https://discord.com/api/webhooks/...",
orders = "https://discord.com/api/webhooks/...",
modifications = "https://discord.com/api/webhooks/...",
society = "https://discord.com/api/webhooks/...",
garage = "https://discord.com/api/webhooks/...",
items = "https://discord.com/api/webhooks/...",
repairs = "https://discord.com/api/webhooks/...",
towing = "https://discord.com/api/webhooks/...",
errors = "https://discord.com/api/webhooks/..."
}Each category has its own enabled flag and a list of individual events underneath it, in Webhooks.Events. A category with no URL simply logs nothing.
Category | Logs |
|---|---|
| Shops created, edited and deleted. |
| Hiring, firing and permission changes. |
| Orders placed and completed, and the parts actually fitted. |
| Money in and out of a shop's funds. |
| Vehicles stored and taken out; tows and flips. |
| Item use, and every repair carried out. |
| Problems the resource ran into. Worth pointing at a private channel. |
Two hooks in config/config.lua let you put your own condition in front of any mechanic action — a licence your server requires, a duty check, a cooldown of your own.
-- Return false to refuse. Leave as nil to allow everything.
Config.CanPerformMechanicAction = nil
-- Runs just before an allowed action. Leave as nil to do nothing.
Config.BeforeMechanicAction = nilBoth ship as nil, and the file documents the arguments each receives above the setting.