ACE3/addons/pylons/functions/fnc_canConfigurePylons.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

28 lines
744 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: 654wak654
* Checks if given unit can access the pylon configuration dialog for the given aircraft.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Aircraft <OBJECT>
*
* Return Value:
* Unit can configure the aircraft's pylons <BOOL>
*
* Example:
* [ace_player, cursorObject] call ace_pylons_fnc_canConfigurePylons
*
* Public: No
*/
params ["_unit", "_aircraft"];
if (GVAR(requireEngineer) && {!([_unit] call EFUNC(common,isEngineer))}) exitWith {false};
if (GVAR(requireToolkit) && {!([_unit, "ToolKit"] call EFUNC(common,hasItem))}) exitWith {false};
if ((_unit distanceSqr _aircraft) > GVAR(searchDistanceSqr)) exitWith {false};
[_unit, _aircraft] call EFUNC(common,canInteractWith)