Jump to content
Sign in to follow this  
fuerst_von_butz

hideBody / deleteVehicle immediately when player dead

Recommended Posts

Hey guys,

I'm working on a ace coop mp mission which ought to run on a dedicated server. Players respawn with the same gear that they have when they die (ace module). To prevent players from duplicating the gear like the powerful weapons of the rifleman or the explosives that only the saboteur has, I want the bodies to be hidden/deleted immediately after a players death. Any advice on this?

Cheers,

Thomas

Share this post


Link to post
Share on other sites

Thanks alot guys, really appreciate the help. And btw, Kylania thanks for your scripting examples, learned alot from it :)

@Rogue: I had exactly the same idea, remove all stuff from the bodys and let the corpses themselves be removed later :)

@Günter: Wrote my own (working) cleanup script, only cleans up dead AIs, vehicles and animals though.

So I did try this:

I already had a trigger with the condition: local player which is used for giving the players their gear. So in that script I added following lines:

player addMPEventHandler ["MPRespawn", {_this spawn _player_killed;}]; 

_player_killed = {
hint "A player was killed, oh noes!";
_corpse = _this select 1;
removeAllWeapons _corpse;
removeAllItems _corpse;
clearMagazineCargoGlobal (unitBackpack _corpse);
sleep 2;
hint "";
};

That unfortunately doesn't work at all :(

Do you see what's wrong?

Cheers,

Thomas

Share this post


Link to post
Share on other sites

You're using a private variable in the handler. It won't exist in its context.

So:

player addMPEventHandler ["MPRespawn", {_this spawn TAG_player_killed;}];

TAG_player_killed = {
hint "A player was killed, oh noes!";
_corpse = _this select 1;
removeAllWeapons _corpse;
removeAllItems _corpse;
clearMagazineCargoGlobal (unitBackpack _corpse);
sleep 2;
hint "";
};

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  

×