Search the Community
Showing results for tags 'removeall'.
Found 1 result
-
The below script is intended to act as a functionality that checks if the killer is player and whether killed is either on the same side as the player or on the enemy side. _TK = addMissionEventHandler ["EntityKilled", { params["_killed", "_killer", "_instigator"]; if ((side _killer == playerSide) && (side group _killed == playerSide) || (side group _killed != playerSide)) then { _this = _this select 0; {_this removeMagazine _x} forEach magazines _this; removeAllItems _this; removeAllAssignedItems _this; }; }]; When a player kills either a friendly soldier or an enemy soldier the code should make it so that all the items and magazines get removed from the now deceased. The code itself works very well for the case: if ((side _killer == playerSide) && (side group _killed == playerSide) but not so well for the case if ((side _killer == playerSide) || (side group _killed != playerSide)) Very often in this particluar case ammunition and items can be picked from the killed enemy soldiers. As much as I understand to read the code it should work as follows: If player is killer AND killed is friendly OR killed is not friendly (is enemy in this case) then remove all items and magazines What I might be missing here? Or should I be looking for completely another approach for what I'm trying to achieve here?
- 4 replies
-
- entitykilled
- playerside
-
(and 2 more)
Tagged with: