add an eventhandler "Killed" to all units.
do this by placing the following in each ai units INIT field in the mission editor
this addEventHandler ["killed", {_this exec "cleanup.sqs"}]and then save the following script in your mission folder
Cleanup.sqs_unit = _this select 0
removeallweapons _unit
~30
deletevehicle _unit
and when that unit dies, his weapons and ammo will be removed instantly from the map.
he will be removed 30 seconds later
Its a lot more efficient than a triggerI added the lines
removeallweapons _unit
~30
deletevehicle _unit
this would be useful if you wanted to delay the deletion of the units body after death.
(There are more elaborate ways of deleting the unit, if a delay is required after the unit has been killed than the example above.
This system is inneficient as each unit will be running a script for 30 seconds after death. )
However, from what you say, you want to delete the unit as soon as it dies, therefore you can simply use the following script instead
Cleanup.sqs_unit = _this select 0
deletevehicle _unit
Another approach maybe to remove all the ammo from the unit, so it doesnt look as odd, as per seabusicuits post
this again can be done in the following way
NB>> No delays, so the removal and readdition of the weapon is unnoticeable
Cleanup.sqs_unit = _this select 0
;;;;_weapon == Primaryweapon _unit
_weapArray = weapons _unit
;;;;_magArray = magazines _unit
removeallweapons player
{_unit addWeapon _x} forEach _weapArray
;;;;; _unit selectweapon _weapon
~30
deletevehicle _unit
exit
if you have problems with the position the weapon appears in, uncomment the blue lines