ACE3/addons/common/functions/fnc_getWeaponModes.sqf

35 lines
585 B
Plaintext
Raw Normal View History

/*
* Author: commy2
2015-09-21 11:08:10 +00:00
* Get the available firing modes of a weapon. Will ignore the AI helper modes.
*
2015-09-21 11:08:10 +00:00
* Arguments:
* 0: Weapon <STRING>
*
2015-09-21 11:08:10 +00:00
* Return Value:
* Firing Modes <ARRAY>
*
2015-09-21 11:08:10 +00:00
* Public: Yes
*/
2015-01-17 17:26:51 +00:00
#include "script_component.hpp"
2015-09-21 11:08:10 +00:00
params ["_weapon"];
2015-09-21 11:08:10 +00:00
private ["_config", "_modes"];
_config = configFile >> "CfgWeapons" >> _weapon;
_modes = [];
2015-09-21 11:08:10 +00:00
{
2015-09-21 11:08:10 +00:00
if (getNumber (_config >> _x >> "showToPlayer") == 1) then {
2015-01-17 17:26:51 +00:00
_modes pushBack _x;
};
if (_x == "this") then {
_modes pushBack _weapon;
};
2015-09-21 11:08:10 +00:00
false
} count getArray (_config >> "modes");
2015-01-17 17:26:51 +00:00
_modes