ACE3/addons/common/functions/fnc_getWeaponModes.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

36 lines
645 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: commy2
* Get the available firing modes of a weapon. Will ignore the AI helper modes.
*
* Arguments:
* 0: Weapon <STRING>
*
* Return Value:
* Firing Modes <ARRAY>
*
* Example:
* ["gun"] call ace_common_fnc_getWeaponModes
*
* Public: Yes
*/
params [["_weapon", "", [""]]];
private _config = configFile >> "CfgWeapons" >> _weapon;
private _modes = [];
{
if (getNumber (_config >> _x >> "showToPlayer") == 1) then {
_modes pushBack _x;
};
if (_x == "this") then {
_modes pushBack _weapon;
};
false
} count getArray (_config >> "modes");
_modes