2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
* Get the available firing modes of a weapon. Will ignore the ai helper modes.
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: A weapon in cfgWeapons (String)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* All firing modes (Array)
|
|
|
|
*/
|
2015-01-17 17:26:51 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
private ["_weapon", "_modes"];
|
|
|
|
|
|
|
|
_weapon = _this select 0;
|
|
|
|
|
|
|
|
_modes = [];
|
|
|
|
{
|
2015-01-17 17:26:51 +00:00
|
|
|
if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then {
|
|
|
|
_modes pushBack _x;
|
|
|
|
};
|
|
|
|
|
|
|
|
if (_x == "this") then {
|
|
|
|
_modes pushBack _weapon;
|
|
|
|
};
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
} forEach getArray (configfile >> "CfgWeapons" >> _weapon >> "modes");
|
2015-01-17 17:26:51 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
_modes
|