wesley32 4 Posted March 29, 2016 Hi all, How would I go about executing killed EH code only on the machine of the killer (or filter him out) with the mission running on a dedicated server?. I see that using addEventHandler ["killed"] only executes on the machine where the unit is local to (server in this case). That means the killer won't have the code executed. I also see that addMPEventHandler ["MPkilled"] will execute the code on every machine. Can't seem to figure this one out. Any help is greatly appreciated! Thanks. Share this post Link to post Share on other sites
sarogahtyp 1108 Posted March 29, 2016 i think u have to add the EH on the machine of the victim (unit) and then u use remoteExec to run code on killers machine. 1 Share this post Link to post Share on other sites
davidoss 552 Posted March 29, 2016 Example params ["_civUnit", "_ehkilledIdx"]; _ehkilledIdx = _civUnit addEventHandler ["killed", { params ["_cvictim", "_ckiller", "_ckillerID"]; if (isnull _ckiller) exitWith {["Unnecessary civilian casualties detected!", "systemChat"] call BIS_fnc_MP;}; if (isPlayer _ckiller) then { if (vehicle _ckiller isEqualTo vehicle _cvictim) exitWith { ["Unnecessary civilian casualties detected!", "systemChat"] call BIS_fnc_MP; }; _ckillerID = owner _ckiller; {[profileName + " has killed civilian!", "systemChat"] call BIS_fnc_MP;} remoteExec ["bis_fnc_call", _ckillerID, false]; } else { if (side _ckiller == west) then { ["Unnecessary civilian casualties detected!", "systemChat"] call BIS_fnc_MP; } else { if (side _ckiller == east) then { ["Enemy is killing civilians, stop this madness", "systemChat"] call BIS_fnc_MP; }; }; }; }]; Share this post Link to post Share on other sites
fn_Quiksilver 1636 Posted March 30, 2016 player addEventHandler [ 'MPKilled', { params ['_killed','_killer']; if (isDedicated) exitWith {}; if (player isEqualTo _killer) then { /* you are the killer */ }; } ]; Share this post Link to post Share on other sites
pedeathtrian 100 Posted March 30, 2016 player addEventHandler [ 'MPKilled', { params ['_killed','_killer']; if (isDedicated) exitWith {}; if (player isEqualTo _killer) then { /* you are the killer */ }; } ]; The "MPKilled" must be used in conjunction with the addMPEventHandler command. 1 Share this post Link to post Share on other sites