Smart Games 76 Posted August 17, 2019 I added the following code to the init of an unit: this addMPEventHandler ["mpkilled",{[(_this select 0), (_this select 1)] call fnc_unitkill}]; I made a money and kill system and i dont want the player to get a reward for teamkilling, thats why i had the following idea: fnc_unitkill = { params ["_victime","_killer"]; if (side _victime == side _killer) then {} else { _money = _killer getVariable "money"; _kills = _killer getVariable "kills"; _exp = _killer getVariable "exp"; _killer setVariable ["money",_money + 100]; _killer setVariable ["kills",_kills + 1]; _killer setVariable ["exp", _exp + 100]; _lgk = _killer getVariable "longestkill"; _dst = _killer distance _victime; if (_dst > _lgk) then {_killer setVariable ["longestkill",_dst]}; }; }; But it dont work... I tried to call the function with this addMPEventHandler ["mpkilled",{[_this] call fnc_unitkill}]; and then.. fnc_unitkill = { _victime = _this select 0; _killer = _this select 1; if (side _victime == side _killer) then {} else { _money = _killer getVariable "money"; _kills = _killer getVariable "kills"; _exp = _killer getVariable "exp"; _killer setVariable ["money",_money + 100]; _killer setVariable ["kills",_kills + 1]; _killer setVariable ["exp", _exp + 100]; _lgk = _killer getVariable "longestkill"; _dst = _killer distance _victime; if (_dst > _lgk) then {_killer setVariable ["longestkill",_dst]}; }; }; doesnt work, too. If i only call it with this addMPEventHandler ["mpkilled",{[_this select 1] call fnc_unitkill}]; then... params ["_killer"]; _money = _killer getVariable "money"; _kills = _killer getVariable "kills"; _exp = _killer getVariable "exp"; _killer setVariable ["money",_money + 100]; _killer setVariable ["kills",_kills + 1]; _killer setVariable ["exp", _exp + 100]; _lgk = _killer getVariable "longestkill"; _dst = _killer distance _victime; if (_dst > _lgk) then {_killer setVariable ["longestkill",_dst]}; it works, but now you get a reward for killing your friends. I really need your help, thanks. 2 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4206 Posted August 17, 2019 3 hours ago, Smart Games said: if (side _victime == side _killer) Hello there Smart Games ! Did you think of using the addMissionEventHandler ? https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/addMissionEventHandler#EntityKilled PS : you could use an exitwith{} there. 1 Share this post Link to post Share on other sites
Smart Games 76 Posted August 18, 2019 I have the same problem.. Share this post Link to post Share on other sites
killzone_kid 1326 Posted August 18, 2019 dead player side is civilian, use if (side group _victime != side group _killer) then {,,,,,,,,,} 2 Share this post Link to post Share on other sites
Smart Games 76 Posted August 18, 2019 @killzone_kid, thank you, its working! 1 Share this post Link to post Share on other sites
Tankbuster 1733 Posted August 18, 2019 There's a function that can return better data, can't remember them right now, am afk. fnc_sideid or fnc_sidetype I think Share this post Link to post Share on other sites