mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
31 lines
529 B
Plaintext
31 lines
529 B
Plaintext
/*
|
|
* Author: commy2
|
|
* Get the turret index of a units current turret.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Turret Index <ARRAY>
|
|
*
|
|
* Example:
|
|
* [ace_player] call ace_common_fnc_getTurretIndex
|
|
*
|
|
* Public: Yes
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
params [["_unit", objNull, [objNull]]];
|
|
|
|
private _vehicle = vehicle _unit;
|
|
if (_unit == _vehicle) exitWith {[]};
|
|
|
|
scopeName "main";
|
|
|
|
{
|
|
if (_unit == (_vehicle turretUnit _x)) then {_x breakOut "main"};
|
|
nil
|
|
} count allTurrets [_vehicle, true];
|
|
|
|
[]
|