behemeth 16 Posted May 27, 2018 Hey all, I'm, trying to find out the Ammo count of CfgMagazine objects in a vehicle/container. I know, I can retrieve the magazine from a container by using getMagazineCargo. However, this only returns the type of magazine and the total count of magazines... Nothing about the actual ammo in the magazines. I found that there now is a setMagazineAmmoCargo command which allows adding magazine with custom ammo count, which is great. Yet, I couldn't find a similar command, like the same as get, to solve my problem of knowing how much ammo is in the magazine in a container. I also tried a workaround with _unit action ["TakeMagazine", _container, _magazineString] to get the magazine and do a count outside the container... However, this only plays the "Take" animation but does nothing else. According to (old) posts, this action is broken. Sadly, the there exist posts reaching back to the Arma 2 days with the given questions and no answers could solve the problem. Maybe you've got some updates for me. Thanks! Share this post Link to post Share on other sites
gokitty1199 225 Posted May 27, 2018 https://community.bistudio.com/wiki/magazinesAmmo it returns the magazines name along with the amount of ammo inside of said magazine in the form of a nested array. so if you want to sort it and get name/ammo from it then use this to separate the name from the ammo(if you not comfortable with nested arrays) and whichever element inside _magNameArry you select, it will have the ammo amount inside the same element slot in _magCountArry _magArry = magazinesAmmo containerName; _magNameArry = []; _magCountArry = []; { _name = (_x select 0); _ammoCount = (_x select 1); _magNameArry pushBack _name; _magCountArry pushBack _ammoCount; } forEach _magArry; 1 Share this post Link to post Share on other sites
behemeth 16 Posted May 28, 2018 Thanks so much @gokitty1199, while it's not the exact command I needed (this seems to only give the vehicle's armament ammo), the command helped me to find magazinesAmmoCargo, which does exactly what I need! Also big thanks for providing the extremely helpful example code! 1 Share this post Link to post Share on other sites
HazJ 1289 Posted May 28, 2018 These? https://community.bistudio.com/wiki/getWeaponCargo https://community.bistudio.com/wiki/getMagazineCargo https://community.bistudio.com/wiki/getItemCargo Share this post Link to post Share on other sites
behemeth 16 Posted May 28, 2018 @HazJ thanks, but no... I already knew those. They don't give the ammo count. See the posts above for the right ones (which are hard to google... at least I didn't find them before @gokitty1199 hint. Here the relevant ones: Adding magazines with specific ammo count to container: https://community.bistudio.com/wiki/addMagazineAmmoCargo Getting the magazines with respective ammo count in a container https://community.bistudio.com/wiki/magazinesAmmoCargo Share this post Link to post Share on other sites
HazJ 1289 Posted May 28, 2018 Ah, okay. There is also: https://community.bistudio.com/wiki/magazinesAmmoFull As shown in the page you listed above. If you haven't already. I recommend you bookmark these: https://community.bistudio.com/wiki/Category:Scripting_Commands_Arma_3 https://community.bistudio.com/wiki/Category:Arma_3:_Functions https://community.bistudio.com/wiki/Arma_3:_Event_Handlers https://community.bistudio.com/wiki/User_Interface_Event_Handlers 1 Share this post Link to post Share on other sites