2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2016-02-22 13:40:04 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Equips the given helicopter with a FRIES.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The helicopter <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [_vehicle] call ace_fastroping_fnc_equipFRIES
|
|
|
|
*
|
2019-04-25 18:31:36 +00:00
|
|
|
* Public: Yes
|
2016-02-22 13:40:04 +00:00
|
|
|
*/
|
|
|
|
params ["_vehicle"];
|
|
|
|
|
2017-09-19 20:38:49 +00:00
|
|
|
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
2016-02-22 13:40:04 +00:00
|
|
|
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 {
|
2017-09-19 20:38:49 +00:00
|
|
|
private _fries = (getText (_config >> QGVAR(friesType))) createVehicle [0, 0, 0];
|
2016-02-22 13:40:04 +00:00
|
|
|
_fries attachTo [_vehicle, (getArray (_config >> QGVAR(friesAttachmentPoint)))];
|
|
|
|
_vehicle setVariable [QGVAR(FRIES), _fries, true];
|
|
|
|
|
2019-04-25 18:31:36 +00:00
|
|
|
_vehicle addEventHandler ["Killed", FUNC(unequipFRIES)];
|
|
|
|
_vehicle addEventHandler ["Deleted", FUNC(unequipFRIES)];
|
2016-02-22 13:40:04 +00:00
|
|
|
};
|
|
|
|
};
|