# Client

## getObjectState

Get the current Object attached to the local player

<mark style="color:red;">**Parameters**</mark>\
**key** - `string` - The current object key name

<mark style="color:green;">**Returns**</mark>\
**object** - `entity` - The entity that is attached to the local player or `nil` if nothing is attached

```lua
local object = exports.msk_handcuffs:getObjectState(key)

-- Example
local object = exports.msk_handcuffs:getObjectState('cuffObject')
local object = exports.msk_handcuffs:getObjectState('uncuffObject')
local object = exports.msk_handcuffs:getObjectState('ankletrackerObject')
local object = exports.msk_handcuffs:getObjectState('headbagObject')
local object = exports.msk_handcuffs:getObjectState('tapeObject')

-- You can also use this:
local object = LocalPlayer.state[key]
```

## getIsHandcuffed

Check if a player is handcuffed or not

<mark style="color:red;">**Parameters**</mark>\
**player** - `table` - This is options and only for other players

<mark style="color:green;">**Returns**</mark>\
**isHandcuffed** - `boolean` - If the Player is handcuffed or not

```lua
-- Self
local isHandcuffed = exports.msk_handcuffs:getIsHandcuffed()

-- Self: You can also use this
local isHandcuffed = LocalPlayer.state.isHandcuffed

-- Other Players
local isHandcuffed = exports.msk_handcuffs:getIsHandcuffed({source = targetId})
```

## getIsHardcuffed

Check if a player is hardcuffed or not

<mark style="color:red;">**Parameters**</mark>\
**player** - `table` - This is options and only for other players

<mark style="color:green;">**Returns**</mark>\
**isHardcuffed** - `boolean` - If the Player is hardcuffed or not

```lua
-- Self
local isHardcuffed = exports.msk_handcuffs:getIsHardcuffed()

-- Self: You can also use this
local isHardcuffed = LocalPlayer.state.isHardcuffed

-- Other Players
local isHardcuffed = exports.msk_handcuffs:getIsHardcuffed({source = targetId})
```

## getHasAnkletracker

Check if a player has an Ankletracker or not

<mark style="color:red;">**Parameters**</mark>\
**player** - `table` - This is options and only for other players

<mark style="color:green;">**Returns**</mark>\
**hasAnkletracker** - `boolean` - If the Player has an Ankletracker or not

```lua
-- Self
local hasAnkletracker = exports.msk_handcuffs:getHasAnkletracker()

-- Self: You can also use this
local hasAnkletracker = LocalPlayer.state.hasAnkletracker

-- Other Players
local hasAnkletracker = exports.msk_handcuffs:getHasAnkletracker({source = targetId})
```

## getHasHeadbag

Check if a player has a Headbag or not

<mark style="color:red;">**Parameters**</mark>\
**player** - `table` - This is options and only for other players

<mark style="color:green;">**Returns**</mark>\
**hasHeadbag** - `boolean` - If the Player has a Headbag or not

```lua
-- Self
local hasHeadbag = exports.msk_handcuffs:getHasHeadbag()

-- Self: You can also use this
local hasHeadbag = LocalPlayer.state.hasHeadbag

-- Other Players
local hasHeadbag = exports.msk_handcuffs:getHasHeadbag({source = targetId})
```

## getHasTape

Check if a player has a Tape or not

<mark style="color:red;">**Parameters**</mark>\
**player** - `table` - This is options and only for other players

<mark style="color:green;">**Returns**</mark>\
**hasTape** - `boolean` - If the Player has a Tape or not

```lua
-- Self
local hasTape = exports.msk_handcuffs:getHasTape()

-- Self: You can also use this
local hasTape = LocalPlayer.state.hasTape

-- Other Players
local hasTape = exports.msk_handcuffs:getHasTape({source = targetId})
```

## cuffPlayer

Cuff a player

<mark style="color:red;">**Parameters**</mark>\
**item** - `string` - The Item with which the player gets cuffed - ***Optional*** \
**player** - `player` - The target Player that gets cuffed - ***Optional***&#x20;

<mark style="color:blue;">**Description**</mark>\
If ***item*** is ***nil*** then the Script will check the correct item from `Config.RestrictItems` if it's enabled or it will cuff the Player without an item `(isAdminCuffed)`

```lua
exports.msk_handcuffs:cuffPlayer(item, player)

-- The player next to your player gets cuffed // Read Description
exports.msk_handcuffs:cuffPlayer()
-- The player next to your player gets cuffed with item cuffs
exports.msk_handcuffs:cuffPlayer('cuffs')
-- closestPlayer gets cuffed // Read Description
exports.msk_handcuffs:cuffPlayer(nil, closestPlayer)
-- closestPlayer gets cuffed with item cuffs
exports.msk_handcuffs:cuffPlayer('cuffs', closestPlayer)
```

## hardcuffPlayer

Hardcuff a player

<mark style="color:red;">**Parameters**</mark>\
**item** - `string` - The Item with which the player gets hardcuffed - ***Optional*** \
**player** - `player` - The target Player that gets hardcuffed - ***Optional***&#x20;

<mark style="color:blue;">**Description**</mark>\
If ***item*** is ***nil*** then the Script will check the correct item from `Config.RestrictItems` if it's enabled or it will hardcuff the Player without an item `(isAdminCuffed)`

```lua
exports.msk_handcuffs:hardcuffPlayer(item, player)

-- The player next to your player gets hardcuffed // Read Description
exports.msk_handcuffs:hardcuffPlayer()
-- The player next to your player gets hardcuffed with item hardcuff
exports.msk_handcuffs:hardcuffPlayer('hardcuff')
-- closestPlayer gets hardcuffed // Read Description
exports.msk_handcuffs:hardcuffPlayer(nil, closestPlayer)
-- closestPlayer gets hardcuffed with item hardcuff
exports.msk_handcuffs:hardcuffPlayer('hardcuff', closestPlayer)
```

## uncuffPlayer

Uncuff a player

It will check if the item is correct or not to uncuff someone.

<mark style="color:red;">**Parameters**</mark>\
**item** - `string` - The Item with which the player gets uncuffed - ***Optional*** \
**player** - `player` - The target Player that gets uncuffed - ***Optional***&#x20;

<mark style="color:blue;">**Description**</mark>\
If ***item*** is ***nil*** then the Script will check the correct item from `Config.RestrictItems` if it's enabled or it will uncuff the Player without an item `(isAdminCuffed)`

```lua
exports.msk_handcuffs:uncuffPlayer(item, player)

-- The player next to your player gets uncuffed // Read Description
exports.msk_handcuffs:uncuffPlayer()
-- The player next to your player gets uncuffed with item cuff_keys
exports.msk_handcuffs:uncuffPlayer('cuff_keys')
-- closestPlayer gets uncuffed // Read Description
exports.msk_handcuffs:uncuffPlayer(nil, closestPlayer)
-- closestPlayer gets uncuffed with item cuff_keys
exports.msk_handcuffs:uncuffPlayer('cuff_keys', closestPlayer)
```

## ankleTrackerPlayer

Activate/Deactivate an Ankletracker for a player

<mark style="color:red;">**Parameters**</mark>\
**player** - `player` - The target Player - ***Optional***&#x20;

```lua
exports.msk_handcuffs:ankleTrackerPlayer(player)

-- The player next to your player
exports.msk_handcuffs:ankleTrackerPlayer()
-- Specific Player
exports.msk_handcuffs:ankleTrackerPlayer(closestPlayer)
```

## headbagPlayer

Activate/Deactivate a Headbag for a player

<mark style="color:red;">**Parameters**</mark>\
**player** - `player` - The target Player - ***Optional***&#x20;

```lua
exports.msk_handcuffs:headbagPlayer(player)

-- The player next to your player
exports.msk_handcuffs:headbagPlayer()
-- Specific Player
exports.msk_handcuffs:headbagPlayer(closestPlayer)
```

## tapePlayer

Activate/Deactivate a Tape for a player

<mark style="color:red;">**Parameters**</mark>\
**player** - `player` - The target Player - ***Optional***&#x20;

```lua
exports.msk_handcuffs:tapePlayer(player)

-- The player next to your player
exports.msk_handcuffs:tapePlayer()
-- Specific Player
exports.msk_handcuffs:tapePlayer(closestPlayer)
```

## dragPlayer / escortPlayer

Drag/Escort the closest player

<mark style="color:red;">**Parameters**</mark>\
**player** - `player` - The target Player - ***Optional***&#x20;

```lua
exports.msk_handcuffs:dragPlayer(player)
-- You can also use
exports.msk_handcuffs:escortPlayer(player)

-- The player next to your player
exports.msk_handcuffs:escortPlayer()
-- Specific Player
exports.msk_handcuffs:escortPlayer(closestPlayer)
```

## putPlayerInCar

Puts the closest player in the car

<mark style="color:red;">**Parameters**</mark>\
**player** - `player` - The target Player - ***Optional***&#x20;

```lua
exports.msk_handcuffs:putPlayerInCar(player)

-- The player next to your player
exports.msk_handcuffs:putPlayerInCar()
-- Specific Player
exports.msk_handcuffs:putPlayerInCar(closestPlayer)
```

## putPlayerOutOfCar

Puts the closest player out of a car

<mark style="color:red;">**Parameters**</mark>\
**player** - `player` - The target Player - ***Optional***&#x20;

```lua
exports.msk_handcuffs:putPlayerOutOfCar(player)

-- The player next to your player
exports.msk_handcuffs:putPlayerOutOfCar()
-- Specific Player
exports.msk_handcuffs:putPlayerOutOfCar(closestPlayer)
```
