ACE3/addons/common/functions/fnc_getWeaponModes.sqf
Phyma ffaa195fe5 Conform function headers to coding guidelines (#5255)
* Fixed headers to work with silentspike python script

* Fixed rest of the files

* Fixed ace-team
2017-06-08 15:31:51 +02:00

36 lines
642 B
Plaintext

/*
* 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
*/
#include "script_component.hpp"
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