unidad2pete 10 Posted June 12, 2013 (edited) Hi; I want to create a AddEventHandler for add to killer 100 points to variable "mymoney" only for killer. in init.sqf: mymoney = 0; player addMPEventHandler ["MPKilled",{ _this select 1 exec "killed.sqf"}]; in killed.sqf mymoney = mymoney + 100; The result is 100 for killer and victim, apparently, killer and victim call killed.sqf and each adds 100 points. My intention was that only the killer call killed.sqf If I call killed.sqf with another action only with the killer, this add 100 correctly and only for killer. As I can do? Edited June 12, 2013 by unidad2pete Share this post Link to post Share on other sites
Tuliq 2 Posted June 12, 2013 You have to make sure that the script only runs on the killers machine dude. player addMPEventHandler ["MPKilled",{ _killer = _this select 1; if (_killer == player) then { _killer execVM "killed.sqf"; }; } ]; alt: player addMPEventHandler ["MPKilled",{ _killer = _this select 1; if (_killer == player) then { mymoney = mymoney + 100; }; } ]; Share this post Link to post Share on other sites
unidad2pete 10 Posted June 13, 2013 Thank you Tuliq, that works fine!! you are genius. Share this post Link to post Share on other sites