JacobJ 10 Posted June 13, 2011 Hey all in and {} foreach list; I am trying to put an eventhandler (killed). But I have a problem. I need it only to be run, when west kills the units in the list. As I have read, the eventhandler killed returns [unit, killer]. But how do I compare the killer with west-side and how do I make the eventhandler only fire, when west kills the unit? /Jacob Share this post Link to post Share on other sites
Muzzleflash 108 Posted June 13, 2011 Assuming you have the unit that west should kill in _targets array: { _x addEventHandler ["killed", { _unit = _this select 0; _killer = _this select 1; if (side _killer != west) exitWith {}; //Do your stuff here. }]; } forEach _targets; Share this post Link to post Share on other sites
JacobJ 10 Posted June 13, 2011 Thank you very much / Tak mange gange - Just what I needed. Now I just have to get the civilians to be counted right, then I am ready to try out my points system. If you can help me with that too, then try to take a look at this thread. Share this post Link to post Share on other sites