Forum Jump :

Author Message

AkeR  



Posts: 3
Rank:


Level: Member

Country: hu
Location:
Occupation:
Age: 34
In-game name: AkeR

 
#1 Posted at 2018-07-20 12:05        
     
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; 

This post was edited by AkeR (2018-07-20 13:19, 681 days ago)