Pac Man 10 Posted October 25, 2013 How would I detect if any given item is a weapon type or a magazine type? Or detect if any given item / object is in cfgMagazines or cfgWeapons or cfgVehicles? IE; if ("m16" isKindOf magazine) then { do stuff } else { do other stuff }; if ("m16" in cfgMagazines) then { do stuff } else { do other stuff }; Thanks. Kind Regards, Pac Man Share this post Link to post Share on other sites
Larrow 2822 Posted October 25, 2013 (edited) if ( isClass (configFile >> "CFGweapons" >> _item)) then { //is weapon }else{ if ( isClass (configFile >> "CFGMagazines" >> _item)) then { //is magazine }else{ //is some other class }; }; Was the way i was doing it earlier today while sorting inventory items. see here (specifically _containerItems in the second bit of code) Edited October 25, 2013 by Larrow Share this post Link to post Share on other sites
-LTac- Imperator 10 Posted October 25, 2013 Thanks for this Larrow, i'm going to be adding this into the little script snippets that I keep around when I need them! Share this post Link to post Share on other sites