I assume that you are asking where you put the code that gives a unit a weapon that he does not already have.
If so, you put this code in the initialization field of the unit. The same goes for adding weapons and ammo to crates.
Technically, you can add weapons and ammo via scripts, waypoints, or triggers, too.