put this in the crate's "init" line:
this addweaponcargo ["<weaponname>",<number in digit form>]
for a weapon, or
this addmagazinecargo ["<magname>",<number in digit form>]
the quotes have to be included around the magazine or weaponname.
As an example:
this addweaponcargo["m16",4]; this addmagazinecargo["m16",40]; this addweaponcargo["m21", 1]; this addmagazinecargo[",m21", 8]
this line of code would put 4 m16 rifles, 40 m16 clips, 1 m21 and 8 m21 magazines in the ammo crate.
Also:
put "clearmagazinecargo this" and "clearweaponcargo this" (without quotes) as the first two parts of the init line, so it looks like this:
clearmagazinecargo this; clearweaponcargo this; <rest of script>
However, none of this probably makes perfect sense, so I've opted to simply make an example mission and attach it.