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 {
|
||||
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.<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"};
|
||||
};
|
||||
};
|
||||
|
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(handleUnitInitPost);
|
||||
PREP(handleZeusDisplayChanged);
|
||||
PREP(moduleHandcuffed);
|
||||
PREP(moduleSettings);
|
||||
PREP(moduleSurrender);
|
||||
PREP(setHandcuffed);
|
||||
|
@ -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"};
|
||||
|
@ -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
|
||||
|
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
|
||||
* 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:
|
||||
* 0: The Module Logic Object <OBJECT>
|
||||
* 0: The Module Logic <OBJECT>
|
||||
* 1: synced objects <ARRAY>
|
||||
* 2: Activated <BOOL>
|
||||
*
|
||||
@ -17,20 +17,19 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_bisMouseOver", "_mouseOverObject"];
|
||||
|
||||
params ["_logic", "_units", "_activated"];
|
||||
|
||||
if (!_activated) exitWith {};
|
||||
TRACE_3("params",_logic,_units,_activated);
|
||||
|
||||
if (local _logic) then {
|
||||
//Modules run before postInit can instal the event handler, so we need to wait a little bit
|
||||
[{
|
||||
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"];
|
||||
{
|
||||
["SetSurrendered", [_x], [_x, true]] call EFUNC(common,targetEvent);
|
||||
} 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>
|
||||
<Russian>Синхронизируйте с юнитами, чтобы сделать их пленными.<br />Источник: ace_captives</Russian>
|
||||
</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">
|
||||
<English>Captives Settings</English>
|
||||
<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