I have found a perfecty working weapon respawn spript, sadly the hide body part works not.
It is for hide the playable/player unit's body and not the opposites.
Inside init: execVM "respawnGear.sqf"; Inside .sqf:
private ["_preventLooting", "_hideBodies", "_sWeaps", "_sMags", "_oldPlayer"];
_preventLooting = _this select 0;
_hideBodies = _this select 1;
while { true } do
{
waitUntil {not alive player};
// Save weapons
_sWeaps = weapons player;
_sMags = magazines player;
if(_preventLooting) then { removeAllWeapons player; };
// In case we need to delete the body on respawn
_player = player;
waitUntil {alive player};
// Hide body
if(_hideBodies) then { hideBody _player; };
// Re-add weapons
removeAllWeapons player;
{ player addMagazine _x; } foreach _sMags;
{ player addWeapon _x; } foreach _sWeaps;
player selectWeapon (primaryWeapon player);
};
Added 1 hour 11 minutes later:
SOLVED
Changed from line 18th:
waitUntil {alive player};
// Hide body
deletevehicle _OldPlayer;