2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-09-21 11:08:10 +00:00
|
|
|
* Author: PabstMirror
|
|
|
|
* Returns the seat position of a UAV that the unit is activly controling.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Position <STRING>
|
|
|
|
* "" = not connected to anything or activly controling
|
|
|
|
* "DRIVER"
|
|
|
|
* "GUNNER"
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [ACE_Player] call ace_common_fnc_getUavControlPosition
|
|
|
|
*
|
|
|
|
* Public: Yes
|
|
|
|
*/
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
params [["_unit", objNull, [objNull]]];
|
2015-09-21 11:08:10 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _uav = getConnectedUAV _unit;
|
2015-09-21 11:08:10 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
if (isNull _uav) exitWith {""};
|
2015-09-21 11:08:10 +00:00
|
|
|
|
2015-12-12 15:48:54 +00:00
|
|
|
private _positionArray = UAVControl _uav;
|
|
|
|
private _playerIndex = _positionArray find _unit;
|
2015-09-21 11:08:10 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
if (_playerIndex == -1) exitWith {""};
|
|
|
|
|
|
|
|
_positionArray select (_playerIndex + 1)
|