2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Gets the optic classnames of all currently equipped weapons.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-02-10 04:22:10 +00:00
|
|
|
* 0: Unit <OBJECT>
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-02-10 04:22:10 +00:00
|
|
|
* 0: Optic of primary <STRING>
|
|
|
|
* 1: Optic of secondary <STRING>
|
|
|
|
* 2: Optic of handgun <STRING>
|
|
|
|
*
|
2015-08-07 14:43:06 +00:00
|
|
|
* Example:
|
|
|
|
* [player] call ace_scopes_fnc_getOptics
|
|
|
|
*
|
2015-02-10 04:22:10 +00:00
|
|
|
* Public: No
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-16 12:15:14 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-07 14:43:06 +00:00
|
|
|
params ["_unit"];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _optics = ["", "", ""];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-08-07 14:43:06 +00:00
|
|
|
if (!(_unit isKindOf "CAManBase")) exitWith {_optics};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
{
|
2015-01-16 12:15:14 +00:00
|
|
|
if (count _x >= 2) then {
|
2015-08-07 14:43:06 +00:00
|
|
|
_optics set [_forEachIndex, _x select 2];
|
2015-01-16 12:15:14 +00:00
|
|
|
};
|
2015-08-08 22:41:43 +00:00
|
|
|
} forEach [primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit];
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-08-07 14:43:06 +00:00
|
|
|
_optics
|