Browse docs
Player Interaction Whitelist
Player Interaction Whitelist
Shared player interactions are job-whitelisted. Register the jobs owned by your resource before using any player-interaction client or server export. Registration authorizes existing jobs only; it does not create framework jobs or Sky Jobs groups.
sky_policejob automatically registers its configured Police jobs with the police policy from Config.JobPlayerInteractions. sky_crimesystem does the same for its Crime jobs and the crime policy. Both refresh their registration after Job Configurator updates.
registerInteractionJobs(groupKey, jobs, permissions?)
groupKey(string) - unique key owned by the calling resource.jobs(string[] | table[]) - job names or job definitions containing aname.permissions(table?) - required for custom groups. It may be omitted whengroupKeyalready has a policy inConfig.JobPlayerInteractions.groups.- Returns
boolean, string?.
Supported permission fields:
| Field | Purpose |
|---|---|
requireOnDuty | Requires the current player to be on duty for every enabled action. |
cuffs | Apply and remove handcuffs. |
zipties | Apply, remove, and cut zipties. |
legRestraints | Apply and remove leg restraints. |
escort | Start and stop escorting a restrained player. |
vehicle | Place escorted players in vehicles or remove restrained players from vehicles. |
headBag | Apply and remove head bags. |
search | Open and transfer items through player search. |
local registered, reason = exports["sky_jobs_base"]:registerInteractionJobs(
"security",
{
"security",
{ name = "security_night" }
},
{
requireOnDuty = true,
cuffs = true,
zipties = false,
legRestraints = true,
escort = true,
vehicle = true,
headBag = false,
search = true
}
)
if not registered then
print(("Unable to register security interactions: %s"):format(reason))
end
Registering jobs only grants the selected interaction capabilities to players whose current job matches the registration. It does not execute an action, bypass item requirements, or trust client input.
unregisterInteractionJobs(groupKey)
Removes a group registered by the calling resource.
exports["sky_jobs_base"]:unregisterInteractionJobs("security")
The export returns false, "not_owner" if another resource owns the group.
hasInteractionAccess(sourceId, permission)
Checks the same server-authoritative job and duty policy used by the interaction actions.
local allowed, reason = exports["sky_jobs_base"]:hasInteractionAccess(source, "search")
Possible failure reasons include not_authorized, not_on_duty, and invalid_permission.