this addeventhandler ["killed",{HideBody (_this select 0)}]
is good for COOP missions,write it in the AI init field and they sink in the ground when killed (a la BF2)
**For MP missions with respawning players U better edit your respawnscript who will run anyway when killed;
@playerRespawnTime == 0
HideBody _unit
somewhere on the end of your script (_unit can be passed by EH killed -->_this select 0)
**If you have a very basic mission without respawnscript you can do it like this:
-in init.sqs:player addeventhandler ["killed",{_this exec "delete.sqs"}]
-delete.sqs:
_corpse = _this select 0
player removealleventhandlers "killed"
@playerRespawnTime == 0
HideBody _corpse
player addeventhandler ["killed",{_this exec "delete.sqs"}]
exit
Note:No doubt SQF will fit better here as this script will be executed many times.
EDIT:The vehicle question:U need DeleteVehicle _wreck (instead of HideBody _unit),but there is no "sink into the ground" effect.