This question was just answered a couple of days ago. Search for "weaponholder" and your question will be answered.
Oh, what the heck.
rpd1="weaponholder" createvehicle blahblahposition
rpd1 addmagazinecargo ["m16",4] (or whatever)
rpd1 addweaponcargo ["m16",1]
You can't actually name the weapon. You have to create a "weaponholder" obect and then add the weapon to it, just like an ammo crate. It takes about 15 seconds after the weapon is added before you can actually take it. I don't know why.
Hope that helps.