HEX
HexscriptsJobscreator

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 ... end

Reason 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
end

Every 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

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.

More