mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Captives - Module to set handcuffing
also add player check for GVAR(requireSurrender) in canApplyHandcuffes
This commit is contained in:
parent
ef681e4332
commit
1c26f6c9f5
@ -153,16 +153,32 @@ class CfgVehicles {
|
|||||||
class GVAR(ModuleSurrender): Module_F {
|
class GVAR(ModuleSurrender): Module_F {
|
||||||
author = ECSTRING(common,ACETeam);
|
author = ECSTRING(common,ACETeam);
|
||||||
category = "ACE";
|
category = "ACE";
|
||||||
displayName = CSTRING(ModuleSurrender_DisplayName); //Make Unit Surrender
|
displayName = CSTRING(ModuleSurrender_DisplayName);
|
||||||
function = QFUNC(moduleSurrender);
|
function = QFUNC(moduleSurrender);
|
||||||
scope = 2; //show in editor
|
scope = 2; //show in editor
|
||||||
isGlobal = 1; //run global
|
isGlobal = 0; //run on server
|
||||||
isTriggerActivated = 1; //Wait for triggers
|
isTriggerActivated = 1; //Wait for triggers
|
||||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
|
icon = QUOTE(PATHTOF(UI\Icon_Module_Make_Unit_Surrender_ca.paa));
|
||||||
functionPriority = 0;
|
functionPriority = 0;
|
||||||
class Arguments {};
|
class Arguments {};
|
||||||
class ModuleDescription: ModuleDescription {
|
class ModuleDescription: ModuleDescription {
|
||||||
description = CSTRING(ModuleSurrender_Description); //Sync a unit to make them surrender.<br/>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"};
|
sync[] = {"AnyAI"};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
BIN
addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa
Normal file
BIN
addons/captives/UI/Icon_Module_Make_Unit_Handcuffed_ca.paa
Normal file
Binary file not shown.
@ -24,6 +24,7 @@ PREP(handlePlayerChanged);
|
|||||||
PREP(handleRespawn);
|
PREP(handleRespawn);
|
||||||
PREP(handleUnitInitPost);
|
PREP(handleUnitInitPost);
|
||||||
PREP(handleZeusDisplayChanged);
|
PREP(handleZeusDisplayChanged);
|
||||||
|
PREP(moduleHandcuffed);
|
||||||
PREP(moduleSettings);
|
PREP(moduleSettings);
|
||||||
PREP(moduleSurrender);
|
PREP(moduleSurrender);
|
||||||
PREP(setHandcuffed);
|
PREP(setHandcuffed);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
class CfgPatches {
|
class CfgPatches {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender)};
|
units[] = {QGVAR(ModuleSettings), QGVAR(ModuleSurrender), QGVAR(ModuleHandcuffed)};
|
||||||
weapons[] = {"ACE_CableTie"};
|
weapons[] = {"ACE_CableTie"};
|
||||||
requiredVersion = REQUIRED_VERSION;
|
requiredVersion = REQUIRED_VERSION;
|
||||||
requiredAddons[] = {"ACE_Interaction"};
|
requiredAddons[] = {"ACE_Interaction"};
|
||||||
|
@ -20,11 +20,12 @@ params ["_unit", "_target"];
|
|||||||
//Check sides, Player has cableTie, target is alive and not already handcuffed
|
//Check sides, Player has cableTie, target is alive and not already handcuffed
|
||||||
|
|
||||||
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&
|
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&
|
||||||
("ACE_CableTie" in (items _unit)) &&
|
{"ACE_CableTie" in (items _unit)} &&
|
||||||
{alive _target} &&
|
{alive _target} &&
|
||||||
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
|
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
|
||||||
{
|
{
|
||||||
(_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious
|
(_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
|
{GVAR(requireSurrender) == 0} || //or don't require surrendering
|
||||||
{_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering
|
{_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering
|
||||||
{(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon
|
{(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon
|
||||||
|
35
addons/captives/functions/fnc_moduleHandcuffed.sqf
Normal file
35
addons/captives/functions/fnc_moduleHandcuffed.sqf
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
* Module Function to make a unit handcuffed (can be called from editor)
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: The Module Logic <OBJECT>
|
||||||
|
* 1: synced objects <ARRAY>
|
||||||
|
* 2: Activated <BOOL>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* Called from module
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
params ["_logic", "_units", "_activated"];
|
||||||
|
|
||||||
|
TRACE_3("params",_logic,_units,_activated);
|
||||||
|
|
||||||
|
if (!_activated) exitWith {};
|
||||||
|
if (!isServer) exitWith {};
|
||||||
|
|
||||||
|
//Modules run before postInit can instal the event handler, so we need to wait a little bit
|
||||||
|
[{
|
||||||
|
params ["_units"];
|
||||||
|
{
|
||||||
|
["SetHandcuffed", [_x], [_x, true]] call EFUNC(common,targetEvent);
|
||||||
|
} forEach _units;
|
||||||
|
}, [_units], 0.05] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
|
deleteVehicle _logic;
|
@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* Author: PabstMirror
|
* Author: PabstMirror
|
||||||
* Module Function to make a unit surrender (can be called from editor, or placed with zeus)
|
* Module Function to make a unit surrender (can be called from editor)
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: The Module Logic Object <OBJECT>
|
* 0: The Module Logic <OBJECT>
|
||||||
* 1: synced objects <ARRAY>
|
* 1: synced objects <ARRAY>
|
||||||
* 2: Activated <BOOL>
|
* 2: Activated <BOOL>
|
||||||
*
|
*
|
||||||
@ -17,20 +17,19 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_bisMouseOver", "_mouseOverObject"];
|
|
||||||
|
|
||||||
params ["_logic", "_units", "_activated"];
|
params ["_logic", "_units", "_activated"];
|
||||||
|
|
||||||
if (!_activated) exitWith {};
|
TRACE_3("params",_logic,_units,_activated);
|
||||||
|
|
||||||
if (local _logic) then {
|
if (!_activated) exitWith {};
|
||||||
//Modules run before postInit can instal the event handler, so we need to wait a little bit
|
if (!isServer) exitWith {};
|
||||||
[{
|
|
||||||
|
//Modules run before postInit can instal the event handler, so we need to wait a little bit
|
||||||
|
[{
|
||||||
params ["_units"];
|
params ["_units"];
|
||||||
{
|
{
|
||||||
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
|
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
|
||||||
} forEach _units;
|
} forEach _units;
|
||||||
}, [_units], 0.05]call EFUNC(common,waitAndExecute);
|
}, [_units], 0.05] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
deleteVehicle _logic;
|
deleteVehicle _logic;
|
||||||
};
|
|
||||||
|
@ -179,6 +179,12 @@
|
|||||||
<Hungarian>Egység szinkronizálása, hogy kapituláljon.<br />Forrás: ace_captives</Hungarian>
|
<Hungarian>Egység szinkronizálása, hogy kapituláljon.<br />Forrás: ace_captives</Hungarian>
|
||||||
<Russian>Синхронизируйте с юнитами, чтобы сделать их пленными.<br />Источник: ace_captives</Russian>
|
<Russian>Синхронизируйте с юнитами, чтобы сделать их пленными.<br />Источник: ace_captives</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Captives_ModuleHandcuffed_DisplayName">
|
||||||
|
<English>Make Unit Handcuffed</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
|
||||||
|
<English>Sync a unit to make them handcuffed.<br />Source: ace_captives</English>
|
||||||
|
</Key>
|
||||||
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
|
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
|
||||||
<English>Captives Settings</English>
|
<English>Captives Settings</English>
|
||||||
<Polish>Ustawienia więźniów</Polish>
|
<Polish>Ustawienia więźniów</Polish>
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in New Issue
Block a user