Worker ID & Menus
Server exports to hand a worker ID or restaurant menu from one player to another, and to read a job's menu image.
showWorkerId
Has playerId present their configured worker ID to targetId hand-over animation on one side,
card on the other.
local ok, err = exports['hex_jobscreator']:showWorkerId(5, 12)Prop
Type
No distance check
Unlike the in-game action this skips the distance check, so it works for scripted hand-overs.
Returns
| Value | Meaning |
|---|---|
true | card sent |
false, reason | see the reasons below |
Reasons
| Code | Meaning |
|---|---|
invalid_player | player id must be a number |
same_player | source and target must differ |
player_not_found | no such sender on the server |
target_not_found | no such target player on the server |
no_workerid_configured | neither of the sender's jobs has a worker ID set up |
showJobMenu
The same thing for the restaurant menu.
local ok, err = exports['hex_jobscreator']:showJobMenu(5, 12)Prop
Type
No distance check
This also skips the distance check.
Returns
| Value | Meaning |
|---|---|
true | menu sent |
false, reason | see the reasons below |
Reasons
| Code | Meaning |
|---|---|
invalid_player | player id must be a number |
same_player | source and target must differ |
player_not_found | no such sender on the server |
target_not_found | no such target player on the server |
no_menu_configured | no restaurant menu is set up |
getJobMenuUrl
The menu image URL configured for a job.
local url, err = exports['hex_jobscreator']:getJobMenuUrl('unicorn')Prop
Type
Returns
| Value | Meaning |
|---|---|
| string | the menu image URL |
nil, reason | invalid_job · unknown_job · no_menu_configured |