I'm still pretty much a n00b at this stuff, too.
To make an array is pretty easy. Let's say you want a variable _wpnArray to have a list of weapons that you're willing to give a guy mags for.
First, you'll need to know the class name of the weapons (check comref, weapons, ArmA).
I think the way you'd do it in the script is.
_wpnArray = ["M4", "AK74", "M240", "PK"];
Your variable _wpnArray will have 4 elements:
_wpnArray select 0 = M4
_wpnArray select 1 = AK74
And so on.
You can use the primaryWeapon command to get the primary weapon for each unit in the trigger. Then, compare the two (I know I've seen that script snippet somewhere around here) and if the primaryWeapon is in the array, add the correct magazine.
Actually, now that I think of it, you may only need a switch/case conditional. (Sorry for the stream of consciousness posting....)
Something like this logic:
- foreach unit in the trigger list, get the primaryWeapon (code might be _reloadWpn = primaryWeapon _x)
- switch _reloadWpn, then case "M4" then add 5 mags for the M4, case AK74, add 5 mags for the AK, and so on
You could maybe even check to see how many mags remaining for the weapon _x has, and add an amount to get the person up to 10.