2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-01-11 18:20:14 +00:00
|
|
|
Name: FUNC(getUavControlPosition)
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
Author: Pabst Mirror
|
|
|
|
|
|
|
|
Description:
|
|
|
|
Gets the seat position of a UAV that the unit is activly controlling.
|
|
|
|
"" - not connected to anything or not activly controling
|
|
|
|
"DRIVER"
|
|
|
|
"GUNNER"
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
0: OBJECT - Unit
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
STRING - Position in the UAV that is currently being controled by the unit.
|
|
|
|
|
|
|
|
Example:
|
2015-01-12 04:02:33 +00:00
|
|
|
[ACE_Player] call FUNC(getUavControlPosition)
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-13 19:56:02 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
private ["_uav", "_positionArray", "_playerIndex"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-05-14 18:06:06 +00:00
|
|
|
PARAMS_1(_unit);
|
2015-01-11 16:42:31 +00:00
|
|
|
_uav = getConnectedUAV _unit;
|
|
|
|
if (isNull _uav) exitWith {""};
|
|
|
|
_positionArray = UAVControl _uav;
|
|
|
|
_playerIndex = _positionArray find _unit;
|
|
|
|
if (_playerIndex == -1) exitWith {""};
|
|
|
|
|
|
|
|
_positionArray select (_playerIndex + 1)
|