Exports
This section lists all client-side and server-side exports in this script. Exports can be called from other scripts to interact with this script functionality.
Note
If you need additional exports for your implementation, please open a ticket on our Discord server.
Every public export of hex_jobscreator is documented in this section what it does, what you pass it
and what you get back.
exports['hex_jobscreator']:exportName(arg1, arg2)Conventions
Every export follows the same shape: the answer comes first, the reason comes second.
-- an action: true on success, false + a reason when it did not happen
local ok, err = exports['hex_jobscreator']:openBossMenu()
if not ok then print(err) end --> 'no_permission'
-- a boolean question: the answer, plus why it is what it is
local cuffed = exports['hex_jobscreator']:isPlayerHandcuffed()
-- a value getter: the value, or nil + a reason
local card, err = exports['hex_jobscreator']:getPlayerBadge(5)
if not card then print(err) end --> 'no_badge'
-- a list getter: always a table, plus a reason when the table is empty
local bills, err = exports['hex_jobscreator']:getPlayerBills(5)
if err == 'no_bills' then ... endReason codes
Reasons are stable snake_case codes, never translated text, so you can safely branch on them:
local ok, err = exports['hex_jobscreator']:openKitchen()
if not ok then
if err == 'not_on_duty' then
-- tell the player to clock in
elseif err == 'too_far' then
-- walk them to the marker
end
endEvery code an export can return is listed on that export's page, and all of them together in the Reason Code Index.
Calling from a thread
A few exports have to talk to the server (or wait on the database) before they can answer. FiveM
supports this the return value comes back normally but only if your call happens inside a
thread: Citizen.CreateThread, SetTimeout, a command handler, or an event handler. Called from
a file's top level, those exports return early with no value.
Citizen.CreateThread(function()
local ok, err = exports['hex_jobscreator']:openBossMenu()
end)Everything else answers instantly and can be called from anywhere.
⏳ Needs a thread
Exports that must be called from a thread are marked with ⏳ Needs a thread right below their name.
Second job
The system supports a second job per player. Anywhere you see is2Job, pass true to target the
second slot; leave it out or pass false for the primary job. Exports that search both slots say so.
Client Exports
Billing
Open the job billing menu and the player's own unpaid bills.
Handcuffs & Escorting
Cuff, uncuff, carry and drag players.
Restaurant Menu
Show a business menu card on screen.
Worker ID
Show an ID card, or hand yours to the closest player.
Permissions
Check whether the local player may use an action.
Duty HUD
Show, hide and query the duty HUD.
Interaction Pages
Boss menu, kitchen, crafting and DJ terminal.
Player & Interaction Info
Read the local player's job, duty state and closest point.
Server Exports
Server exports have no source
Server exports run outside of a player context, so every player-scoped export takes the player's server id as its first argument.
Jobs
Read jobs, grades, members, interactions and notify a whole job.
Player Jobs
Read and set a player's job, grade and duty state.
Society Money
Read, add and remove money on a society account.
Badges
Read and assign service numbers.
Licenses
Read, give and revoke licences through the licence bridge.
Billing
Send a bill on behalf of an employee and read unpaid bills.
Business State
Open and close a business server-wide.
Worker ID & Menus
Hand a worker ID or restaurant menu from one player to another.
Logs
Write your own entries into a job's audit log.