Browse docs

Player Interactions

Reference for Player Interactions in sky_jobs_base.

All client exports

Player Interactions

For identity and license views, see the document exports.

The client exports below open or execute the shared handcuff, ziptie, leg-restraint, escort, vehicle, head-bag, and player-search flows.

Calling a client export does not grant access. The player's current job must be registered through the server export registerInteractionJobs, and the server validates the whitelist, duty state, target, distance, restraint state, and required items again when the action is executed. sky_policejob and sky_crimesystem register their configured jobs automatically.

The old civilianUse and skipAccess options are no longer supported. Do not pass them. For another job resource, register its jobs on the server before exposing any of these client actions.

hasInteractionAccess(permission)

Returns boolean, string? for the local player's current server-authoritative whitelist and duty access. Permission names are cuffs, zipties, legRestraints, escort, vehicle, headBag, and search.

local allowed, reason = exports["sky_jobs_base"]:hasInteractionAccess("search")

Handcuffs and zipties

getCuffAvailability(action, options)

Checks whether an action is currently available without executing it.

  • action (string) - cuff, uncuff, ziptie, unziptie, or cut_ziptie.
  • options.targetId (number?) - server ID of a specific target. The nearest player is used when omitted.
  • options.displayOnly (boolean?) - use true while building a menu. Missing cuff, ziptie, or cutter items and the ziptie hands-up execution requirement do not hide the action in this mode. Call the real action export without displayOnly; it validates these requirements and returns the failure reason for the user-facing message.
  • Returns boolean, table? - availability and context or failure information.
local available, context = exports["sky_jobs_base"]:getCuffAvailability("ziptie", {
    targetId = targetId,
    displayOnly = true
})

requestCuff(cuffType, options) and requestUncuff(cuffType, options)

Runs the validated cuff flow for the nearest player or options.targetId.

  • cuffType (string) - cuffs or zipties.
  • Returns boolean, string? - whether the request started and an optional failure reason.
exports["sky_jobs_base"]:requestCuff("zipties", {
    targetId = targetId
})

Nearest-player cuff exports

ExportPurpose
cuffPlayer(cuffType, options?)Applies cuffs or zipties to the nearest valid player.
uncuffPlayer(options?)Removes the nearest player's current restraints.
cutZipties(options?)Cuts the nearest player's zipties with the configured cutter.
isPlayerCuffed(serverId?)Returns whether the selected target or local player is currently cuffed.
useHandcuffsItem()Starts the handcuff item flow.
useZiptiesItem()Starts the ziptie item flow.
getCuffConfig()Returns a read-only snapshot of Config.PoliceCuffs.

useCuffPlayer, useUncuffPlayer, and useCutZipties are compatibility aliases. They use the same job whitelist and do not bypass access checks.

Escape minigame

Escape opportunities are configured through Config.PoliceCuffs.escape in sky_jobs_base/config/config.lua. The server rolls the chance when restraints are applied and owns every minigame round. There is no public client export or event for forcing an escape opportunity or declaring success.

Leg restraints

ExportPurpose
getLegRestraintsAvailability(action, options?)Checks apply or remove for options.targetId or the nearest player.
applyLegRestraints(options?)Applies leg restraints to the selected valid target.
removeLegRestraints(options?)Removes leg restraints from the selected valid target.
isLegRestrained()Returns whether the local player currently has leg restraints.
getLegRestraintsConfig()Returns a read-only snapshot of Config.LegRestraints.
local available = exports["sky_jobs_base"]:getLegRestraintsAvailability("apply", {
    targetId = targetId
})

if available then
    exports["sky_jobs_base"]:applyLegRestraints({
        targetId = targetId
    })
end

The acting job needs the legRestraints permission. The server also validates the target, distance, vehicle state, item requirement, current restraint state, and Config.LegRestraints.requireCuffed.

Escort and vehicle actions

getEscortAvailability(action, options)

  • action (string) - escort, place_in_vehicle, or take_out_vehicle.
  • options.targetId (number?) - specific target for the escort action.
  • Returns boolean, table?.
local available = exports["sky_jobs_base"]:getEscortAvailability("escort", {
    targetId = targetId
})

Escort exports

ExportPurpose
escortToggle()Starts or stops escorting the nearest cuffed player.
escortToggleTarget(targetId, options?)Starts or stops escorting a specific cuffed player.
escortPutInVehicle()Places the currently escorted player in the nearest valid vehicle.
escortTakeOutVehicle()Removes a cuffed player from the nearest vehicle.
escortPlaceInVehicle(options?)Availability-driven variant used by menu integrations.
escortRemoveFromVehicle(options?)Availability-driven removal variant.
getEscortConfig()Returns a read-only snapshot of Config.PoliceEscort.

The escort and vehicle permissions are separate. A job can be allowed to escort players without being allowed to place them in or remove them from vehicles.

Head bag

ExportPurpose
getHeadBagAvailability(action, options?)Checks apply or remove for options.targetId or the nearest player.
applyHeadBag(options?)Applies a head bag to the selected valid target.
removeHeadBag(options?)Removes the selected target's head bag.
useHeadBag(options?)Toggles a head bag on the nearest player or options.targetId.
useHeadBagTarget(options?)Compatibility alias for useHeadBag.
isHeadBagged()Returns whether the local player is currently hooded.
getHeadBagConfig()Returns a read-only snapshot of Config.HeadBag.
exports["sky_jobs_base"]:applyHeadBag({
    targetId = targetId
})

Applying or removing a head bag from another player requires the headBag whitelist permission. A hooded player may still use the configured self-remove flow.

ExportPurpose
getPlayerSearchAvailability(options?)Checks the nearest target.
getTargetPlayerSearchAvailability(targetId, options?)Checks a specific target.
getPlayerSearchConfig()Returns a read-only snapshot of Config.PlayerSearch.
startPlayerSearch(context?)Starts the search UI for context.targetId or the nearest target.
local available = exports["sky_jobs_base"]:getTargetPlayerSearchAvailability(targetId)

if available then
    exports["sky_jobs_base"]:startPlayerSearch({
        targetId = targetId
    })
end

The target must be nearby and restrained. Inventory reads and every item transfer are validated again on the server.