2015-05-18 12:28:13 +00:00
|
|
|
/*
|
|
|
|
* Author: SilentSpike
|
2015-07-20 20:07:53 +00:00
|
|
|
* Flips the capture state of the unit the module is placed on.
|
2015-05-18 12:28:13 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-15 20:11:49 +00:00
|
|
|
* 0: The module logic <OBJECT>
|
|
|
|
* 1: Synchronized units <ARRAY>
|
|
|
|
* 2: Activated <BOOL>
|
2015-05-18 12:28:13 +00:00
|
|
|
*
|
2015-08-15 20:11:49 +00:00
|
|
|
* Return Value:
|
2016-11-15 12:07:48 +00:00
|
|
|
* None
|
2015-05-18 12:28:13 +00:00
|
|
|
*
|
2015-08-15 20:11:49 +00:00
|
|
|
* Public: No
|
2015-05-18 12:28:13 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-03 23:20:41 +00:00
|
|
|
params ["_logic", "_units", "_activated"];
|
2015-08-15 20:11:49 +00:00
|
|
|
private ["_mouseOver", "_unit", "_captive"];
|
2015-05-18 12:28:13 +00:00
|
|
|
|
2015-07-29 11:25:04 +00:00
|
|
|
if !(_activated && local _logic) exitWith {};
|
2015-05-18 12:28:13 +00:00
|
|
|
|
|
|
|
if (isNil QEFUNC(captives,setHandcuffed)) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(RequiresAddon)] call FUNC(showMessage);
|
2015-05-18 12:28:13 +00:00
|
|
|
} else {
|
2015-07-20 20:07:53 +00:00
|
|
|
_mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]);
|
2015-05-18 12:28:13 +00:00
|
|
|
|
2015-07-20 20:07:53 +00:00
|
|
|
if ((_mouseOver select 0) != "OBJECT") then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(NothingSelected)] call FUNC(showMessage);
|
2015-05-18 21:49:47 +00:00
|
|
|
} else {
|
2015-07-20 20:07:53 +00:00
|
|
|
_unit = effectivecommander (_mouseOver select 1);
|
|
|
|
|
2015-05-18 21:49:47 +00:00
|
|
|
if !(_unit isKindOf "CAManBase") then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(OnlyInfantry)] call FUNC(showMessage);
|
2015-05-18 21:49:47 +00:00
|
|
|
} else {
|
|
|
|
if !(alive _unit) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(OnlyAlive)] call FUNC(showMessage);
|
2015-05-18 21:49:47 +00:00
|
|
|
} else {
|
|
|
|
_captive = GETVAR(_unit,EGVAR(captives,isHandcuffed),false);
|
|
|
|
// Event initalized by ACE_Captives
|
2016-05-25 18:23:53 +00:00
|
|
|
[QEGVAR(captives,setHandcuffed), [_unit, !_captive], _unit] call CBA_fnc_targetEvent;
|
2015-05-18 21:49:47 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2015-05-18 12:28:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
deleteVehicle _logic;
|