There is no way of automatically doing it. Sorry, you will have to do it by hand.
Meaning, you have to manually construct an array with all of the ammocrates in it.
So, lets say you have 3 ammo crates, named a1, a2, and a3. Then, in your init.sqs, you would just need to place a line like this:
ammo_crates = [a1, a2, a3]
Now the global variable "ammo_crates" will contain all 3 of your crates. Simple, eh? But what if you have lots of crates, and you don't want to name them all? Well, you could make a simple script to be run from each crate's init field, which adds them to the variable. So in each crate's init field, you would put this:
this exec "addtovar.sqs"
addtovar.sqs:
~0.1 + random 0.1
ammo_crates = ammo_crates + [_this]
exit
And finally, in your init.sqs:
ammo_crates = []