2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2016-12-15 05:55:06 +00:00
|
|
|
/*
|
|
|
|
* Author: 654wak654
|
|
|
|
* Add/Removes FRIES from a helicopter.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The module logic <OBJECT>
|
|
|
|
* 1: Synchronized units <ARRAY>
|
|
|
|
* 2: Activated <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [LOGIC, [bob, kevin], true] call ace_zeus_fnc_moduleAddOrRemoveFRIES
|
|
|
|
*
|
2016-12-15 05:55:06 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2017-12-10 18:29:38 +00:00
|
|
|
params ["_logic"];
|
2016-12-15 05:55:06 +00:00
|
|
|
|
2017-12-10 18:29:38 +00:00
|
|
|
if !(local _logic) exitWith {};
|
2016-12-15 05:55:06 +00:00
|
|
|
|
|
|
|
if !(["ace_fastroping"] call EFUNC(common,isModLoaded)) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(RequiresAddon)] call FUNC(showMessage);
|
2016-12-15 05:55:06 +00:00
|
|
|
} else {
|
|
|
|
(GETMVAR(BIS_fnc_curatorObjectPlaced_mouseOver,[""])) params ["_mouseOverType", "_mouseOverUnit"];
|
|
|
|
|
|
|
|
if (_mouseOverType != "OBJECT") then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(NothingSelected)] call FUNC(showMessage);
|
2016-12-15 05:55:06 +00:00
|
|
|
} else {
|
|
|
|
if !(alive _mouseOverUnit) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(OnlyAlive)] call FUNC(showMessage);
|
2016-12-15 05:55:06 +00:00
|
|
|
} else {
|
2021-02-18 18:58:08 +00:00
|
|
|
private _config = configOf _mouseOverUnit;
|
2016-12-15 05:55:06 +00:00
|
|
|
private _displayName = getText (_config >> "displayName");
|
|
|
|
if !(isNumber (_config >> QEGVAR(fastroping,enabled))) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(NotFastRopeCompatible), _displayName] call FUNC(showMessage);
|
2016-12-15 05:55:06 +00:00
|
|
|
} else {
|
|
|
|
private _fries = GETVAR(_mouseOverUnit,EGVAR(fastroping,FRIES),objNull);
|
|
|
|
if (isNull _fries) then {
|
|
|
|
[QGVAR(equipFries), [_mouseOverUnit]] call CBA_fnc_serverEvent;
|
|
|
|
} else {
|
|
|
|
if ([_mouseOverUnit] call EFUNC(fastroping,canCutRopes)) then {
|
2017-03-02 23:47:49 +00:00
|
|
|
[LSTRING(CantRemoveFRIES), _displayName] call FUNC(showMessage);
|
2016-12-15 05:55:06 +00:00
|
|
|
} else {
|
|
|
|
[_mouseOverUnit] call EFUNC(fastroping,cutRopes);
|
|
|
|
deleteVehicle _fries;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
deleteVehicle _logic;
|