From 9603faed15b70d5a77c46f259708334e97fab4d7 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Fri, 15 Jan 2021 03:44:09 -0600 Subject: [PATCH] Add handcuff item type script --- scripts/server/item/handcuff.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 scripts/server/item/handcuff.js diff --git a/scripts/server/item/handcuff.js b/scripts/server/item/handcuff.js new file mode 100644 index 00000000..9a6781d9 --- /dev/null +++ b/scripts/server/item/handcuff.js @@ -0,0 +1,31 @@ +// =========================================================================== +// Asshat-Gaming Roleplay +// https://github.com/VortrexFTW/gtac_asshat_rp +// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com) +// --------------------------------------------------------------------------- +// FILE: handcuff.js +// DESC: Provides features and usage for the handcuff item type +// TYPE: Server (JavaScript) +// =========================================================================== + +// --------------------------------------------------------------------------- + +function isPlayerHandCuffed(client) { + return (getPlayerData(client).pedState == AG_PEDSTATE_BINDED); +} + +// --------------------------------------------------------------------------- + +function handCuffPlayer(client) { + getPlayerData(client).pedState = AG_PEDSTATE_BINDED; + setPlayerControlState(client, false); +} + +// --------------------------------------------------------------------------- + +function unHandCuffPlayer(client) { + getPlayerData(client).pedState = AG_PEDSTATE_READY; + setPlayerControlState(client, true); +} + +// --------------------------------------------------------------------------- \ No newline at end of file