Jump to content
Sign in to follow this  
curtcooll

Delete dead bodie

Recommended Posts

How do you implement removing ai dead bodie when they re spawn. i tried putting deletevehicle _guy but nothing happens.

if (!isServer) exitWith {};

_unit 			= _this select 0;
_lives			= _this select 1;
_delay 			= _this select 2;
_respawn_point	= _this select 3;
_move_script	= _this select 4;
_group			= _this select 5;
_side 			= _this select 6;
_AI_unitArray	= _this select 7;
_AI_magArray	= _this select 8;
_AI_wepArray	= _this select 9; 

_unitsGroup = units (group _unit);

while {(count _unitsGroup) > 0} do
{	
_remainingUnits = [];
{if (alive _x) then {_remainingUnits = _remainingUnits + [_x]}} forEach _unitsGroup;
_unitsGroup = _remainingUnits;
sleep 1;
};
deleteGroup _group;
if (_lives == 0) exitWith {};
_lives = _lives - 1;
_wait = Time + _delay;
waitUntil {Time > _wait};
_group = createGroup _side; 

{_x createUnit [(getMarkerPos _respawn_point), _group];} forEach _AI_unitArray;
sleep 2;
hint "AI respawn";
_unitsGroup = units _group;
{_x disableAI "MOVE"} forEach _unitsGroup;

for [{ _loop = 0 },{ _loop < count  _unitsGroup},{ _loop = _loop + 1}] do
{
_guy = _unitsGroup select _loop;
removeAllWeapons _guy;
{_guy removeMagazine _x} forEach magazines _guy;
removeAllItems _guy;
{_guy addMagazine _x} forEach (_AI_magArray select _loop);
{_guy addWeapon _x}   forEach (_AI_wepArray select _loop);
_guy selectWeapon (primaryWeapon _guy);
   if (_loop == 0) then {_guy moveInDriver heli};
_guy setSkill (_AI_skillArray select _loop);
sleep 0.1;
};
{_x enableAI "MOVE"} forEach _unitsGroup;
_leader = leader _group;
[_leader, _lives, _delay, _respawn_point, _move_script, _group, _side, _AI_unitArray,_AI_magArray, _AI_wepArray] execVM "AI_respawn\AI_respawn.sqf"; 	
[_leader] execVM _move_script;

if (true) exitWith {};

Edited by curtcooll

Share this post


Link to post
Share on other sites

And I thought Bodie was still partners with Doyle..

However, if you mean bodies, then the "hideBody" command is your friend..

Share this post


Link to post
Share on other sites

i would add it to loop as so _guy == alive (hideBody}; is that correct? gonna try it anyway. tried it didnt work how would i put it in my for loop.

Share this post


Link to post
Share on other sites

Ok thanks for that works great only issue is that the ai re spawn script im using it wont delete those dead bodies how would i change the script to account for the ai.

Share this post


Link to post
Share on other sites
Ok thanks for that works great only issue is that the ai re spawn script im using it wont delete those dead bodies how would i change the script to account for the ai.

Try Celery's CLY Remove Dead Script. I use it in my firefight mission with respawning AI and players.

My mission is here if you want to see the combination of scripts I used. http://www.armaholic.com/page.php?id=18809

Share this post


Link to post
Share on other sites

yeah the ai re spawn mate but issue is i have separate script for helicopter pilot it deletes players and ai bodies but not the pilot ai that uses re spawn ai script.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×