R4Z0R49/DayZMod — pull request #88 by KillzoneKid (2012-11-13 12:33:14+00:00)
Title: Rearm Hueys and other vehicles

This will show you available weapons when in gunner/commander position and give you Add AMMO to... option for each weapon. It will tell you what ammo you need if you don't have it in inventory. The script called from action menu is called ammo.sqf and is here https://gist.github.com/4065495

Few notes. Only one magazine can be loaded at a time. If you have 99 bullets left and have 100 round magazine in your inventory, you will lose it for 1 bullet when add ammo. In general I found a lot of bugs connected with rearmament, maybe this is why they invented ammo trucks. So this is the best I could come up with without complicating things too much and at the same time make it usable.