2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-09-16 21:01:01 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Checks if the unit can deploy ropes from the helicopter.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2019-01-12 03:05:25 +00:00
|
|
|
* 0: The helicopter itself <OBJECT>
|
|
|
|
* 1: Unit occupying the helicopter <OBJECT>
|
|
|
|
* 2: Rope classname <STRING>
|
|
|
|
* 3: Default (show when setting disabled) <BOOL> (default: false)
|
2015-09-16 21:01:01 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Able to deploy ropes <BOOL>
|
|
|
|
*
|
|
|
|
* Example:
|
2019-01-12 03:05:25 +00:00
|
|
|
* [vehicle player, player, "ACE_rope36"] call ace_fastroping_fnc_canDeployRopes
|
2015-09-16 21:01:01 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2019-01-12 03:05:25 +00:00
|
|
|
params ["_vehicle", "_player", "_ropeClass", ["_defaultOption", false]];
|
2015-09-16 21:01:01 +00:00
|
|
|
|
2021-02-18 18:58:08 +00:00
|
|
|
private _config = configOf _vehicle;
|
2015-11-30 17:35:34 +00:00
|
|
|
|
2019-01-12 03:05:25 +00:00
|
|
|
(driver _vehicle != _player) &&
|
|
|
|
{getPos _vehicle select 2 > 2} && {
|
|
|
|
private _enabled = getNumber (_config >> QGVAR(enabled));
|
|
|
|
_enabled == 1 || {_enabled == 2 && {!(isNull (_vehicle getVariable [QGVAR(FRIES), objNull]))}}
|
|
|
|
} && {
|
|
|
|
private _deploymentStage = _vehicle getVariable [QGVAR(deploymentStage), 0];
|
|
|
|
if (getText (_config >> QGVAR(onPrepare)) == "") then { _deploymentStage == 0 } else { _deploymentStage == 2 };
|
|
|
|
} && {
|
|
|
|
(_defaultOption && {!GVAR(requireRopeItems)}) || {(_ropeClass in (_player call EFUNC(common,uniqueItems))) || {_ropeClass in (itemCargo _vehicle)}}
|
2016-02-28 23:34:14 +00:00
|
|
|
}
|