diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp
index afda86cfda..eff1cf4c52 100644
--- a/addons/captives/CfgVehicles.hpp
+++ b/addons/captives/CfgVehicles.hpp
@@ -153,16 +153,32 @@ class CfgVehicles {
class GVAR(ModuleSurrender): Module_F {
author = ECSTRING(common,ACETeam);
category = "ACE";
- displayName = CSTRING(ModuleSurrender_DisplayName); //Make Unit Surrender
+ displayName = CSTRING(ModuleSurrender_DisplayName);
function = QFUNC(moduleSurrender);
scope = 2; //show in editor
- isGlobal = 1; //run global
+ isGlobal = 0; //run on server
isTriggerActivated = 1; //Wait for triggers
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
functionPriority = 0;
class Arguments {};
class ModuleDescription: ModuleDescription {
- description = CSTRING(ModuleSurrender_Description); //Sync a unit to make them surrender.
Source: ace_captives
+ description = CSTRING(ModuleSurrender_Description);
+ sync[] = {"AnyAI"};
+ };
+ };
+ class GVAR(ModuleHandcuffed): Module_F {
+ author = ECSTRING(common,ACETeam);
+ category = "ACE";
+ displayName = CSTRING(ModuleHandcuffed_DisplayName);
+ function = QFUNC(moduleHandcuffed);
+ scope = 2; //show in editor
+ isGlobal = 0; //run on server
+ isTriggerActivated = 1; //Wait for triggers
+ icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Handcuffed_ca.paa));
+ functionPriority = 0;
+ class Arguments {};
+ class ModuleDescription: ModuleDescription {
+ description = CSTRING(ModuleHandcuffed_Description);
sync[] = {"AnyAI"};
};
};
diff --git a/addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa b/addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa
new file mode 100644
index 0000000000..85c556cb2a
Binary files /dev/null and b/addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa differ
diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf
index b59249b937..dcc585ef8e 100644
--- a/addons/captives/XEH_preInit.sqf
+++ b/addons/captives/XEH_preInit.sqf
@@ -24,6 +24,7 @@ PREP(handlePlayerChanged);
PREP(handleRespawn);
PREP(handleUnitInitPost);
PREP(handleZeusDisplayChanged);
+PREP(moduleHandcuffed);
PREP(moduleSettings);
PREP(moduleSurrender);
PREP(setHandcuffed);
diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp
index cdaf6dc4e4..a9ec2950ee 100644
--- a/addons/captives/config.cpp
+++ b/addons/captives/config.cpp
@@ -2,7 +2,7 @@
class CfgPatches {
class ADDON {
- units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender)};
+ units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender), QGVAR(ModuleHandcuffed)};
weapons[] = {"ACE_CableTie"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_Interaction"};
diff --git a/addons/captives/functions/fnc_canApplyHandcuffs.sqf b/addons/captives/functions/fnc_canApplyHandcuffs.sqf
index 368ce3cb7a..f5fa666652 100644
--- a/addons/captives/functions/fnc_canApplyHandcuffs.sqf
+++ b/addons/captives/functions/fnc_canApplyHandcuffs.sqf
@@ -20,11 +20,12 @@ params ["_unit", "_target"];
//Check sides, Player has cableTie, target is alive and not already handcuffed
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&
-("ACE_CableTie" in (items _unit)) &&
+{"ACE_CableTie" in (items _unit)} &&
{alive _target} &&
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
{
(_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious
+ {!([_target] call EFUNC(common,isPlayer))} || //is an AI (not a player)
{GVAR(requireSurrender) == 0} || //or don't require surrendering
{_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering
{(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon
diff --git a/addons/captives/functions/fnc_moduleHandcuffed.sqf b/addons/captives/functions/fnc_moduleHandcuffed.sqf
new file mode 100644
index 0000000000..4c6cc4c6fc
--- /dev/null
+++ b/addons/captives/functions/fnc_moduleHandcuffed.sqf
@@ -0,0 +1,35 @@
+/*
+ * Author: PabstMirror
+ * Module Function to make a unit handcuffed (can be called from editor)
+ *
+ * Arguments:
+ * 0: The Module Logic