HEX
HexscriptsJobscreatorExportsClient Exports

Worker ID

Client exports to show a worker ID card on screen, or hand the player's own card to the closest player.

openWorkerId

Needs a thread but only when photo is set. See Calling from a thread.

Shows a worker ID card on the local player's screen.

exports['hex_jobscreator']:openWorkerId({
    logo = 'https://example.com/logo.png',
    firstName = 'John',
    lastName = 'Doe',
    badge = 'A102',
    jobLabel = 'Police',
    gradeLabel = 'Sergeant',
    grade = 3,
    photo = 13
})

Prop

Type

About photo

photo takes a player's server id, not an image. The card renders that player's live head shot. Leave it out for a card with no photo, which also makes the call instant. If the head shot cannot be produced (player not streamed in, no ped) the card still opens, just without a picture.

Returns

ValueMeaning
truecard shown
false, reasonsee the reasons below

Reasons

CodeMeaning
invalid_datathe argument must be a table
closed_while_loadingthe card was closed while its head shot was still rendering

closeWorkerId

Closes the worker ID card.

local ok, err = exports['hex_jobscreator']:closeWorkerId()

Returns

ValueMeaning
truecard closed
false, 'not_open'no card was showing

showWorkerIdToClosest

Hands the player's own configured worker ID to the nearest player, animations included the same thing the action menu entry does.

local ok, err = exports['hex_jobscreator']:showWorkerIdToClosest()

Returns

ValueMeaning
truesent
false, reasonsee the reasons below

Reasons

CodeMeaning
no_player_nearbynobody within range
no_workerid_configuredno worker ID is set up