2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Gets the optic classnames of all currently equipped weapons.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit (Object)
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* [optic of primary, optic of secondary, optic of handgun] (Array)
|
|
|
|
*/
|
|
|
|
|
2015-01-16 12:15:14 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
private ["_unit", "_array"];
|
|
|
|
|
|
|
|
_unit = _this select 0;
|
|
|
|
|
|
|
|
_array = ["", "", ""];
|
|
|
|
|
|
|
|
if !(_unit isKindOf "CAManBase") exitWith {_array};
|
|
|
|
|
|
|
|
{
|
2015-01-16 12:15:14 +00:00
|
|
|
if (count _x >= 2) then {
|
|
|
|
_array set [_forEachIndex, _x select 2];
|
|
|
|
};
|
2015-01-11 16:42:31 +00:00
|
|
|
} forEach [primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit];
|
|
|
|
|
|
|
|
_array
|