Jump to content
Asmodeuz

[SOLVED] Remove all magazines and items from soldiers upon getting killed

Recommended Posts

Hello,

 

I thought the following script would remove all magazines from a soldier (be it a dynamically spawned AI or human player) upon getting killed but for reasons unknown to me nothing gets removed ever:

_removeMagazinesFromAnyone = addMissionEventHandler ["EntityKilled", {
        params["_killed","_killer","_instigator"];

        if (_killed isKindOf "CAManBase") then {
                (_this select 0) spawn {
                sleep 1;
                {_this removeMagazine _x} forEach magazines _this;
                };
        };
}];

When testing the script with a mission on a dedicated server there's no script errors. What gives in this case?

All in all I'm looking for a script that would remove everything* else from killed units except the containers (vest, backpack, uniform) they use to carry stuff.

*though not necessarily main weapon since there's another script that makes picking one up not possible

 

Edit: Solved by using in this case removeMagazineGlobal instead of just removeMagazine

Share this post


Link to post
Share on other sites
9 minutes ago, gc8 said:

That was it then, removeMagazineGlobal.. damned that I at in no point happened to stumble on that before coming here to ask :face_palm:
Any way, cheers gc8 for coming and sharing this quick fix!

  • Like 1

Share this post


Link to post
Share on other sites
10 hours ago, Asmodeuz said:

All in all I'm looking for a script that would remove everything* else from killed units except the containers (vest, backpack, uniform) they use to carry stuff.

 

Hello there Asmodeuz !

 

Check this:

 

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

×