what you will probably need to do is update the playable unit arrays after every respawn
This is how to do it
1) Create a gamelogic and name it SERVER
2) Add the following to the init.sqs
tx_PlayableArray = [W1,W2,W3,..... etc etc etc]
tx_updateArray = objnull
player addEventHandler ["killed", {_this exec "playerkilled.sqs"}]
[]exec ArrayUpdate.sqs
3) Create script ArrayUpdate.sqs
?!(local Server):exit
~ (Random 2)
;;Playerarray_update.sqs
;;Maintains PlayerArray integrity, use it for whatever you want
#START
@ (not isnull tx_updateArray)
#UPDATE
tx_PlayableArray = tx_PlayableArray + [tx_updateArray]
tx_updateArray = objnull
{deletevehicle _x} forEach tx_PlayableArray
goto "START"
4) Create script Playerkilled.sqs
player removeAllEventHandlers "Killed"
@alive player
tx_updateArray = player; PublicVariable "tx_updateArray"
player addEventHandler ["killed", {_this exec "playerkilled.sqs"}]
exit
in theory every time somebody is killed, the update script will self clean any ai units (Untested), however i know the array update system works because i use it a lot
NB>>> note the use of a tag "tx_" before any global variable, this is to help reduce conflicts when addons are also being run alongside the scripts