2015-11-26 13:56:19 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Equips synched helicopters with a FRIES.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Module <LOGIC>
|
|
|
|
* 1: Units <ARRAY>
|
|
|
|
* 2: Activated <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [_vehicle] call ace_fastroping_cutRopes
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
params ["_module"];
|
|
|
|
private ["_synchedUnits", "_config", "_fries"];
|
|
|
|
|
|
|
|
_synchedUnits = synchronizedObjects _module;
|
|
|
|
{
|
|
|
|
if (_x isKindOf "CAManBase") then {
|
|
|
|
_x = vehicle _x;
|
|
|
|
};
|
|
|
|
_config = configFile >> "CfgVehicles" >> typeOf _x;
|
|
|
|
if !(isNumber (_config >> QGVAR(enabled))) then {
|
|
|
|
["%1 has not been configured for ACE_Fastroping.", getText (_config >> "DisplayName")] call BIS_fnc_error;
|
|
|
|
} else {
|
|
|
|
if (getNumber (_config >> QGVAR(enabled)) == 2) then {
|
|
|
|
_fries = (getText (_config >> QGVAR(friesType))) createVehicle [0, 0, 0];
|
|
|
|
_fries attachTo [_x, (getArray (_config >> QGVAR(friesAttachmentPoint)))];
|
|
|
|
_x setVariable [QGVAR(FRIES), _fries, true];
|
2015-11-29 23:14:46 +00:00
|
|
|
_x addEventHandler ["Killed", {
|
|
|
|
params ["_vehicle"];
|
|
|
|
deleteVehicle (_vehicle getVariable [QGVAR(FRIES), objNull]);
|
|
|
|
_vehicle setVariable [QGVAR(FRIES), nil, true];
|
|
|
|
|
|
|
|
if !((_vehicle getVariable [QGVAR(deployedRopes), []] isEqualTo [])) then {
|
|
|
|
[_vehicle] call FUNC(cutRopes);
|
|
|
|
};
|
|
|
|
}];
|
2015-11-26 13:56:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
false
|
|
|
|
} count _synchedUnits;
|