Walteria.net Labs

Server

Server exports for wlabs_handcuff

Use these from server-side scripts to manage player states.

CuffPlayer

Cuff a player with standard permission and item checks.

exports['wlabs_handcuff']:CuffPlayer(source, targetId, cuffType, isAggressive, bypassItems, bypassAlign, restraintId)
  • source: (number) Player doing the cuffing.
  • targetId: (number) Player being cuffed.
  • cuffType: (string) 'front' or 'back'.
  • isAggressive: (boolean) Use intensive sync alignment.
  • bypassItems: (boolean) Skip handcuff item requirement.
  • bypassAlign: (boolean) Skip client alignment (walk-to-position).
  • restraintId: (string?) Key in Config.Restraints (for example 'cuffs', 'cable_ties').

UncuffPlayer

Uncuff a player with standard permission and item checks.

exports['wlabs_handcuff']:UncuffPlayer(source, targetId, bypassItems, isInstant, bypassAlign)
  • bypassItems: (boolean) Skip handcuff key requirement.
  • isInstant: (boolean) Skip animations and state-change delays (instant).
  • bypassAlign: (boolean) Skip client alignment (walk-to-position).

DragPlayer

Start escorting a cuffed player (server-validated).

exports['wlabs_handcuff']:DragPlayer(source, targetId, bypassAlign)
  • bypassAlign: (boolean) Skip client alignment (walk-to-position).

PutInVehicle

Put a cuffed player into a vehicle seat (server-validated).

exports['wlabs_handcuff']:PutInVehicle(source, targetId, vehicleNetId, seat)
  • vehicleNetId: (number) Network ID of the vehicle.
  • seat: (number) Seat index.

If vehicleNetId/seat are omitted, the closest vehicle to source is used; if source is 0, it falls back to targetId.

This uses a server-side nearest-vehicle lookup (ox_lib lib.getClosestVehicle).

RemoveFromVehicle

Remove a player from a vehicle (server-validated).

exports['wlabs_handcuff']:RemoveFromVehicle(source, targetId)

RequestBreak

Start a break attempt (lockpick/knife) on a cuffed player.

exports['wlabs_handcuff']:RequestBreak(source, targetId, method)
  • method: (string) 'lockpick' or 'knife'.

IsPlayerCuffed

Check if a specific player ID is currently cuffed.

local isCuffed = exports['wlabs_handcuff']:IsPlayerCuffed(targetId)

GetPlayerCuffType

Get the orientation a player was cuffed from.

local cuffType = exports['wlabs_handcuff']:GetPlayerCuffType(targetId) -- 'front', 'back', or nil

GetPlayerRestraintType

Get the restraint type a player is cuffed with.

local restraintType = exports['wlabs_handcuff']:GetPlayerRestraintType(targetId) -- for example 'cuffs', 'cable_ties'

GetClosestPlayer

Get closest player serverId + distance (server-side).

local targetId, dist = exports['wlabs_handcuff']:GetClosestPlayer(source, maxDistance)

CuffPlayerBypass

Cuff a player without permission, item, or alignment checks.

exports['wlabs_handcuff']:CuffPlayerBypass(source, targetId, cuffType, isAggressive, restraintId)

UncuffPlayerBypass

Uncuff a player without permission, item, or alignment checks.

exports['wlabs_handcuff']:UncuffPlayerBypass(source, targetId, isInstant)