mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
add functions to get cfg type of items and objects
This commit is contained in:
parent
0daa029622
commit
b66bb4ffd6
@ -57,6 +57,8 @@ PREP(getAllGear);
|
|||||||
PREP(getCaptivityStatus);
|
PREP(getCaptivityStatus);
|
||||||
PREP(getConfigCommander);
|
PREP(getConfigCommander);
|
||||||
PREP(getConfigGunner);
|
PREP(getConfigGunner);
|
||||||
|
PREP(getConfigType);
|
||||||
|
PREP(getConfigTypeObject);
|
||||||
PREP(getDeathAnim);
|
PREP(getDeathAnim);
|
||||||
PREP(getDefaultAnim);
|
PREP(getDefaultAnim);
|
||||||
PREP(getDefinedVariable);
|
PREP(getDefinedVariable);
|
||||||
|
24
addons/common/functions/fnc_getConfigType.sqf
Normal file
24
addons/common/functions/fnc_getConfigType.sqf
Normal 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"};
|
||||||
|
|
||||||
|
""
|
22
addons/common/functions/fnc_getConfigTypeObject.sqf
Normal file
22
addons/common/functions/fnc_getConfigTypeObject.sqf
Normal 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"};
|
||||||
|
|
||||||
|
""
|
Loading…
Reference in New Issue
Block a user