Ok here is the script...
It needs to be refined the position to the weapons dropped....
After a little experimenting I noticed that select 0 is always the primary weapon
and select 1 is the rpg or law etc...
It does not depend on which weapon is in the unit's hand when he is killed...
These script will drop one weapon if he had 1, two if he had two...with the ammo the dude had
_dead = _this select 0
_weapons = weapons _dead
? count _weapons == 1: goto "1weapon"
? count _weapons == 2: goto "2weapons"
#1weapon
_ammo01 = _dead Ammo format ["%1",_weapons select 0]
_weapon01 ="WeaponHolder" CreateVehicle getPos _dead
_weapon01 addWeaponCargo [format ["%1",_weapons select 0], 1]
_weapon01 addMagazineCargo [format ["%1",_weapons select 0], _ammo01]
_dead removeWeapon format ["%1",_weapons select 0]
goto "end"
#2weapons
_ammo01 = _dead Ammo format ["%1",_weapons select 0]
_ammo02 = _dead Ammo format ["%1",_weapons select 1]
_weapon01 ="WeaponHolder" CreateVehicle getPos _dead
_weapon02 ="WeaponHolder" CreateVehicle getPos _dead
_weapon01 addWeaponCargo [format ["%1",_weapons select 0], 1]
_weapon01 addMagazineCargo [format ["%1",_weapons select 0], _ammo01]
_weapon02 addWeaponCargo [format ["%1",_weapons select 1], 1]
_weapon02 addMagazineCargo [format ["%1",_weapons select 1], _ammo02]
_dead removeWeapon format ["%1",_weapons select 0]
_dead removeWeapon format ["%1",_weapons select 1]
#end
exit