Permissions
Check whether the local player may use a given action, across both job slots.
hasPlayerAccess
Whether the local player may use a given action, checking both job slots and taking grade limits and duty state into account.
local ok, err = exports['hex_jobscreator']:hasPlayerAccess('handcuffs')Prop
Type
Accepted names
action accepts three kinds of name.
Single action
| Category | Actions |
|---|---|
| Civil | handcuff_back handcuff_front release search drag put_in_vehicle out_vehicle |
| EMS | revive small big ems_putin ems_putout |
| Vehicle | vehicle_info hijack repair wash impound plate_lookup low_loader |
| License | give_license revoke_license |
Whole category
Passing a category returns true if any action in it is allowed.
civil · ems · vehicle · license
Friendly alias
| Alias | Covers |
|---|---|
handcuffs | any of the three cuff actions |
dragging | the drag action |
workerId | the worker ID action |
menu / jobmenu | the job menu |
billing | billing |
objects / object_spawner | the object spawner |
Case sensitivity
Aliases are case-insensitive; raw action names are not.
Returns
| Value | Meaning |
|---|---|
true | allowed right now |
false, reason | see the reasons below |
Reasons
| Code | Meaning |
|---|---|
invalid_action | action must be a non-empty string |
unknown_action | not an action, category or alias check the spelling |
no_access | the job does not grant this action, or the grade is too low |
not_on_duty | the job has a duty point and the player is clocked out |
Server side
The server has its own check, hasPlayerActionAccess,
which takes raw action names only no categories or aliases.