ACE3/addons/fcs/functions/fnc_canUseFCS.sqf
PabstMirror e8693c8db9
Various - Use configOf command for faster lookup (#8100)
* configOf

* replace some use of CBA_fnc_getObjectConfig
2021-02-18 12:58:08 -06:00

22 lines
605 B
Plaintext

#include "script_component.hpp"
/*
* Author: commy2
* Called from config. Returns true if the player is a gunner and the players current vehicle has a FCS.
*
* Arguments:
* None
*
* Return Value:
* Boolean <BOOL>
*
* Example:
* [] call ace_fcs_fnc_canUseFCS
*
* Public: No
*/
getNumber ([configOf vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call EFUNC(common,getTurretConfigPath) >> QGVAR(Enabled)) == 1
&& {cameraView == "GUNNER"}
&& {!([ACE_player] call CBA_fnc_canUseWeapon)} //Not Turned Out
&& {cameraOn != (getConnectedUAV ACE_player)} //Not Controlling a UAV