/* * Author: commy2 * Get the turret index of a units current turret. * * Arguments: * 0: Unit * * Return Value: * Turret Index * * Public: Yes */ #include "script_component.hpp" params ["_unit"]; private ["_vehicle", "_turrets", "_units", "_index"]; _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {[]}; _turrets = allTurrets [_vehicle, true]; _units = []; { _units pushBack (_vehicle turretUnit _x); false } count _turrets; _index = _units find _unit; if (_index == -1) exitWith {[]}; _turrets select _index;