add functions to get cfg type of items and objects

This commit is contained in:
commy2 2015-04-01 19:36:11 +02:00
parent 0daa029622
commit b66bb4ffd6
3 changed files with 48 additions and 0 deletions

View File

@ -57,6 +57,8 @@ PREP(getAllGear);
PREP(getCaptivityStatus);
PREP(getConfigCommander);
PREP(getConfigGunner);
PREP(getConfigType);
PREP(getConfigTypeObject);
PREP(getDeathAnim);
PREP(getDefaultAnim);
PREP(getDefinedVariable);

View File

@ -0,0 +1,24 @@
/*
* Author: commy2
*
* What kind of Cfg is the item. Works for CfgMagaines, CfgWeapons and CfgGlasses
*
* Argument:
* 0: A item's classname. (String)
*
* Return value:
* CfgWhatever (String)
*/
#include "script_component.hpp"
private "_item";
_item = _this select 0;
if (isClass (configFile >> "CfgWeapons" >> _item)) exitWith {"CfgWeapons"};
if (isClass (configFile >> "CfgMagazines" >> _item)) exitWith {"CfgMagazines"};
if (isClass (configFile >> "CfgGlasses" >> _item)) exitWith {"CfgGlasses"};
""

View File

@ -0,0 +1,22 @@
/*
* Author: commy2
*
* What kind of Cfg is the object. Works for CfgVehicles and CfgAmmo
*
* Argument:
* 0: An object's classname. (String)
*
* Return value:
* CfgWhatever (String)
*/
#include "script_component.hpp"
private "_object";
_object = _this select 0;
if (isClass (configFile >> "CfgVehicles" >> _object)) exitWith {"CfgVehicles"};
if (isClass (configFile >> "CfgAmmo" >> _object)) exitWith {"CfgAmmo"};
""