Handcuffs & Escorting
Client exports to cuff and uncuff the local player, and to read the current carry and escort state.
isPlayerHandcuffed
Whether the local player is currently cuffed.
if exports['hex_jobscreator']:isPlayerHandcuffed() then
-- the player is cuffed
endReturns
| Value | Meaning |
|---|---|
true | player is cuffed |
false, 'not_handcuffed' | player is not cuffed |
isPlayerCarrying
Whether a ped is playing one of the carry animations.
local carrying = exports['hex_jobscreator']:isPlayerCarrying()Prop
Type
Returns
| Value | Meaning |
|---|---|
true | ped is carrying someone |
false, reason | see the reasons below |
Reasons
| Code | Meaning |
|---|---|
invalid_ped | that ped does not exist |
not_carrying | the ped is not carrying anyone |
isPlayerEscorting
Whether the local player is dragging someone, being dragged, or neither.
local escorting, target = exports['hex_jobscreator']:isPlayerEscorting()
if escorting then
print('dragging player ' .. target)
endReturns
| Value | Meaning |
|---|---|
true, targetServerId | player is dragging someone; the second value is who |
false, 'being_escorted' | the player is the one being dragged |
false, 'not_escorting' | neither |
stopEscort
Ends an escort in either direction and tells the server, so both sides drop out of it.
local ok, err = exports['hex_jobscreator']:stopEscort()Returns
| Value | Meaning |
|---|---|
true | escort ended |
false, 'not_escorting' | nothing to stop |
addHandcuffs
Cuffs the local player.
Plays the cuff sound, applies the animation, blocks the usual controls and writes the state so it survives a reconnect exactly like being cuffed by a police officer in game.
local ok, err = exports['hex_jobscreator']:addHandcuffs(0)Prop
Type
Returns
| Value | Meaning |
|---|---|
true | cuffs applied |
false, reason | see the reasons below |
Reasons
| Code | Meaning |
|---|---|
invalid_cuff_type | cuff type must be 0 or 1 |
already_handcuffed | the player is already cuffed |
player_dead | the player is fatally injured |
removeHandcuffs
Removes the local player's cuffs.
local ok, err = exports['hex_jobscreator']:removeHandcuffs()Returns
| Value | Meaning |
|---|---|
true | cuffs removed |
false, 'not_handcuffed' | player was not cuffed |