Jump to content
Sign in to follow this  
Auss

Deleting Players dead bodies

Recommended Posts

I've searched for a script that will do this with no luck. I want to be able to delete players dead bodies after a certain time. I am using a script (remover.sqs) to delete dead AI which seems to work ok, sometimes it will not delete a vehicle but I can live with that. I cant seem to delete dead player bodies though, Can anyone help with this?

Share this post


Link to post
Share on other sites

just attach a killed EH to each unit you want want a remove body done on.

eg.

init.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">KilledEH      = compile preprocessfile "scripts\mp_client\KilledEH.sqf";

RemoveBody    = compile preprocessfile "scripts\mp_client\RemoveBody.sqf";

RemoveBodyDelay = 10;

player addEventHandler ["killed", {_dummy = _this spawn KilledEH;}];

or make an an array units either with a trigger or just hard coded and do a...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">aryUnits = [W1,W2,W3,E1,E2,E3];

{_x addEventHandler ["killed", {_dummy = _this spawn KilledEH;}];} forEach aryUnits;

KilledEH.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_Unit","_Killer"];

_Unit = _this select 0;

_Killer = _this select 1;

_handle = [_Unit] spawn RemoveBody;

RemoveBody.sqf...

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_Body"];

_Body = _this select 0;

sleep (RemoveBodyDelay * 60);

waitUntil {hideBody _Body;};

sleep 2;

deletevehicle _Body;

there's lots of subtley different things you can do... but essentially it just killed event>runs killed script>spawns a script thread to eventually fade the body out...

Share this post


Link to post
Share on other sites

Thanks fellas nice work, I'll try these scripts out

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  

×