Jump to content
Sign in to follow this  
Taylor1984

Check when mortar is out of ammo

Recommended Posts

Hi!

 

How can I check when a mortar is out of ammo?

 

_count = _mortar ammo "sh_82mm_amos"

 

? (_count == 0) : blablablaa

 

doesnt seem to work

 

Thanks

Share this post


Link to post
Share on other sites
if(count magazines _mortar == 0)then{hint "yep"};

It counts flares & smokes too.

  • Like 1

Share this post


Link to post
Share on other sites
6 hours ago, Taylor1984 said:

Hi!

 

How can I check when a mortar is out of ammo?

 

_count = _mortar ammo "sh_82mm_amos"

 

? (_count == 0) : blablablaa

 

doesnt seem to work

 

Thanks

 

You can use @Floofs check, or this if you only want to take harmful ammo that can do damage into account:

 


_mortar = YourMortar;
_hasHarmfulAmmo = count (magazines _mortar select {

	_ammo = getText (configfile >> "CfgMagazines" >> _x >> "ammo");
	_hit = getNumber (configfile >> "CfgAmmo" >> _ammo >> "hit");
	_hit > 0

}) > 0;
systemchat format ["Mortar has harmful ammo: %1",_hasHarmfulAmmo];

_hasHarmfulAmmo returns true if it has harmful ammo and false if not.

 

Cheers

  • Like 2

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  

×