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
photois 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
| Value | Meaning |
|---|---|
true | card shown |
false, reason | see the reasons below |
Reasons
| Code | Meaning |
|---|---|
invalid_data | the argument must be a table |
closed_while_loading | the card was closed while its head shot was still rendering |
closeWorkerId
Closes the worker ID card.
local ok, err = exports['hex_jobscreator']:closeWorkerId()Returns
| Value | Meaning |
|---|---|
true | card 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
| Value | Meaning |
|---|---|
true | sent |
false, reason | see the reasons below |
Reasons
| Code | Meaning |
|---|---|
no_player_nearby | nobody within range |
no_workerid_configured | no worker ID is set up |