I don't care if more than one magazine can have the same amount of ammo, I just want to remove <b>at least one</b> of the magazines that contain a specific quantity of ammo (e.g. the youngest one / highest ID if there are many of them)
Let me explain. Let's say I have a vanilla static weapon with 3 full magazines containing 500 ammo. With my persistence system, saved data for this static weapon shows that in the previous session, there were 2 magazines left, each with 300 and 400 ammo. Now, I want to restore those magazines with their specific ammo count, but I would like to keep the static weapon's max resupply capability at 3 mags with 500 ammo. With those commands implemented, here's what I'd do:
<pre>
// set the ammo for the 3 initial mags at 0, then:
{
} forEach _savedMags;
reload _staticWeapon;
</pre>
And there ya go, now you have one 300-ammo mag, one 400-ammo mag, and one empty mag. So, if you bring an ammo truck near it, it will resupply it to the default 3 mags with 500 ammo. All is good, no id needed. Simple, clean, and effective. In the end, it's just about flexibility.
@<b>BIS_fnc_KK</b>: On a different note, I'm wondering - are you Killzone Kid? or a completely different guy?