I thought you might be interested in looking at addWeapon script (adds correct magazines automatically).
https://forums.bohemia.net/forums/topic/96941-addweapon-script-adds-correct-magazines-automatically/?do=findComment&comment=1979466
× Pasted as rich text. Restore formatting
Only 75 emoji are allowed.
× Your link has been automatically embedded. Display as a link instead
× Your previous content has been restored. Clear editor
× You cannot paste images directly. Upload or insert images from URL.