Commands#
Trucker Job registers no chat or console commands. Everything a driver does starts at the dispatcher and is played with a few keys, and everything another script needs is an export or an event further down this page.
Key | Where | What it does |
|---|---|---|
| Beside the dispatcher | Opens the job panel. With |
| The job panel | Closes it, or steps back out of the shop, the statistics or the guide. |
| At a pile of boxes, on foot | Opens the loading view on a hand-loaded run — at a dock to load, at the drop-off to unload. |
Mouse | The loading view | Point at a box, hold the left button to pick it up, release over the marker to drop it. |
| The loading view | Leaves it. |
| The drop-off · the bay · the depot | Delivers the trailer, drops the emptied trailer off, hands the truck back and gets paid. |
The interact key is Config.Keys.InteractKey — control 38, E by default. Any id from the FiveM controls list works.
Client Exports#
For opening the panel from your own scripts — an NPC manager, a radial menu, a phone app, a job centre.
Opening the job panel
-- client
exports['qs-truckjob']:openTruckerMenu()
-- server
TriggerClientEvent('qs-truck:openTruckerMenu', source)The panel holds the contracts, the shop, the statistics and the guide, so this is the one way in — there is no separate entry point for the shop or the leaderboard. The close-up camera on the dispatcher is only used when the player is standing within 6 metres of them; from anywhere else the panel simply opens.
Server Exports#
How another resource asks about drivers — a job centre that refuses a second job during a run, a scoreboard that counts truckers, a jail script that takes a driver off the road.
IsPlayerOnMission — is this player on a run?
local onRun = exports['qs-truckjob']:IsPlayerOnMission(source) -- true / falseRead from the server's own record of the run, so no client can talk it either way. isPlayerOnRoute(source) answers the same question and is kept for scripts that already call it.
cancelRoute — end a player's run
local ended = exports['qs-truckjob']:cancelRoute(source)
-- true if the player had a run, false if they did notThe run is dropped without pay, and the player's client clears everything away: the truck, the trailer, any boxes, the blips, the tracker and the outfit. The right call for a jail, a hospital or an admin tool.
getOnDutyCount · isPlayerOnDuty — drivers on duty
local count = exports['qs-truckjob']:getOnDutyCount() -- drivers working right now
local onDuty = exports['qs-truckjob']:isPlayerOnDuty(source) -- true / falseA headcount for scoreboards such as qs-scoreboard. A driver goes on duty when a run starts and off when it ends. The flag is reported by the player's own client and nothing in the job pays out from it — whenever the answer matters, use IsPlayerOnMission.
Hooks in the Config#
Four values in config/config.lua are there for you to point at your own resources:
Hook | Runs | Use it for |
|---|---|---|
| On the driver's client, when a stolen-cargo run is reported. | Alerting the police through your dispatch script. |
| On the client, for every message, when | Your own notification resource. |
| On both sides, wherever money is written out. | How amounts look. Reads |
| On the client, when the truck spawns, if | Your fuel script's exports — anything with |
Examples for each are in Integrations.
About the Errors#
Every server answer that can refuse returns a translation key rather than a sentence — NOTIFY_NOT_ENOUGH_LEVEL, NOTIFY_TRAILER_NOT_AT_BAY, NOTIFY_CARGO_WRONG_DOCK — so the same refusal reads in the server's own language. Common Errors lists them with what each one means.



