Jump to content
Sign in to follow this  
Pac Man

cfg path problems - counting ammo type

Recommended Posts

I'm trying to count the players primary magazines. It returns the magazine type as the parent class, thus defaulting to 0. What is wrong with my path? I want to reference a 30Rnd_65x39_caseless_mag & not "B_65x39_Caseless" in this example. Config viewer says ammo = "B_65x39_Caseless";. But how can I get the actual magazine returned as text string? I've tried using "type" at the end. Any help is appreciated. If any of this makes any sense!

_PWAmmoType = getText (configfile >> "CfgMagazines" >> primaryWeaponMagazine player select 0 >> "ammo");
_PWCountType = ({_x == _PWAmmoType} count magazines player);
player sideChat format ["%1",_PWAmmoType];
player sideChat format ["%1",_PWCountType];

Share this post


Link to post
Share on other sites

isn't (primaryWeaponMagazine player select 0) sufficient?

i.e. hint primaryWeaponMagazine player; //["30Rnd_65x39_caseless_mag"]

so no need to check config

Share this post


Link to post
Share on other sites

SOLVED

Thanks for opening my eyes. I was over complicating things. This is what I did.

_PWAmmoType = primaryWeaponMagazine player;
_PWCountType = ({_x == _PWAmmoType select 0} count magazines player);
player sideChat format ["%1",_PWAmmoType];
player sideChat format ["%1",_PWCountType];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×