BEAKSBY 11 Posted July 3, 2014 I want to say... if there is no _killer then assign _killer = to the player(human) on the opposite side of _unit (that was killed). I'm stuck at: if ( isNull _killer) then {_killer = ??? something with playerSide , player and _unit and not ???}; Thanks in-advance BTW this is for when an explosion kills an unit nearby since the "Killed" Event Handler does not return the killer for this case. Share this post Link to post Share on other sites
tpw 2315 Posted July 3, 2014 How about tsomething like this? _unit addeventhandler ["killed", { private ["_unit","_killer"]; _unit = _this select 0; _killer = _this select 1; if (isNull _killer) then { if ((side player) getFriend (side _unit) < 0.6) { _killer = player; }; }; }]; Not on Arma box, can't test it for you. Share this post Link to post Share on other sites
BEAKSBY 11 Posted July 3, 2014 How about tsomething like this? _unit addeventhandler ["killed", { private ["_unit","_killer"]; _unit = _this select 0; _killer = _this select 1; if (isNull _killer) then { if ((side player) getFriend (side _unit) < 0.6) { _killer = player; }; }; }]; Not on Arma box, can't test it for you. Yes but this is for MP, don't you have to designate the side of the player then? Share this post Link to post Share on other sites
tpw 2315 Posted July 3, 2014 Yes but this is for MP, don't you have to designate the side of the player then? Silly me, I completely overlooked where you asked about this being for MP. https://community.bistudio.com/wiki/playerSide Share this post Link to post Share on other sites
f2k sel 164 Posted July 3, 2014 Dead/killed unit will be Civilian, to get the actual side you will need to check the config real_side = getNumber (configFile/"CfgVehicles"/(typeOf _unit)/"side"); results should be as follows 0=east 1=west 2=resistance 3=civilian Share this post Link to post Share on other sites
Lala14 135 Posted July 3, 2014 REALSIDE I suggest using faction does the same as above. Share this post Link to post Share on other sites
BEAKSBY 11 Posted July 3, 2014 (edited) REALSIDEI suggest using faction does the same as above. Thanks, but... ...In my MP script when a unit in the "Killed" Event Handler is killed by a nearby explosion explosion, the Dead/killed unit will be Civilian, to get the actual side you will need to check the config as F2K Sel described.So, getting back to my original request in post #1, I think my script should look like this: _unit addeventhandler ["killed", { private ["_unit","_killer"]; _unit = _this select 0; _killer = _this select 1; _realSide = 0; if ((side _unit) == civilian) then { //---if dead soldier was killed by an explosion _realSide = getNumber (configFile/"CfgVehicles"/(typeOf _unit)/"side"); //---get actual side of dead soldier if (side player != _realSide) then {_killer = player}; //---set player as _killer of _unit }; Edited July 3, 2014 by BEAKSBY Share this post Link to post Share on other sites
Lala14 135 Posted July 4, 2014 I was going to also suggest what about sideEnemy Share this post Link to post Share on other sites