mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
1c6c4d6bff
* Fix Brackets around code * Update fnc_handleFired.sqf * Shouldn't have changed this one --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
33 lines
644 B
Plaintext
33 lines
644 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Gets the optic classnames of all currently equipped weapons.
|
|
*
|
|
* Arguments:
|
|
* 0: Unit <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* 0: Optic of primary <STRING>
|
|
* 1: Optic of secondary <STRING>
|
|
* 2: Optic of handgun <STRING>
|
|
*
|
|
* Example:
|
|
* [player] call ace_scopes_fnc_getOptics
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit"];
|
|
|
|
private _optics = ["", "", ""];
|
|
|
|
if !(_unit isKindOf "CAManBase") exitWith {_optics};
|
|
|
|
{
|
|
if (count _x >= 2) then {
|
|
_optics set [_forEachIndex, _x select 2];
|
|
};
|
|
} forEach [primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit];
|
|
|
|
_optics
|