2015-05-19 16:17:10 +00:00
|
|
|
/*
|
2015-05-21 12:54:00 +00:00
|
|
|
* Author: joko // Jonas
|
|
|
|
* Add the Reserve Parachute to Units or Save Backpack if is a Parachute in Unit
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* 0: Unit
|
|
|
|
* 1: getAllGear-Array
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
private ["_unit","_backpack"];
|
|
|
|
_unit = _this select 0;
|
|
|
|
_backpack = (_this select 1) select 6 ;
|
2015-05-23 21:50:38 +00:00
|
|
|
if ((vehicle _unit) isKindOf "ParachuteBase" && backpack ACE_player == "" && !(_unit getVariable [QGVAR(chuteIsCut),false]) && (_unit getvariable [QGVAR(hasReserve),false])) then {
|
2015-05-21 12:54:00 +00:00
|
|
|
_unit addBackpack (_unit getVariable[QGVAR(backpackClass),"ACE_NonSteerableParachute"]);
|
|
|
|
} else {
|
|
|
|
if ([false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))) then {
|
|
|
|
_unit setVariable[QGVAR(backpackClass),getText(configFile >> "CfgVehicles" >> _backpack >> "ace_reserveParachute")];
|
|
|
|
};
|
|
|
|
if (!(_unit getVariable [QGVAR(chuteIsCut),false]) && !(animationState _unit == 'para_pilot')) then {
|
|
|
|
_unit setVariable [QGVAR(hasReserve),[false,true] select (getNumber(configFile >> "CfgVehicles" >> _backpack >> "ace_hasReserveParachute"))];
|
|
|
|
};
|
|
|
|
};
|