Jump to content
Sign in to follow this  
nebulazerz

Need Help With A Killed Killer Event Handler

Recommended Posts

Try this?

this addEventHandler ["Killed",
	{
		_killed = param [0,objNull];
		_killer = param [1,objNull];

		if (isPlayer _killer) then 
		{
			if (side _killer == side _killed) exitWith {"You killed a friendly player! bad boy!" remoteExec["hint", _killer]};
			remoteExec["cashonKillerFunction", _killer];
		};
	}
];

Share this post


Link to post
Share on other sites

 

Try this?

this addEventHandler ["Killed",
	{
		_killed = param [0,objNull];
		_killer = param [1,objNull];

		if (isPlayer _killer) then 
		{
			if (side _killer == side _killed) exitWith {"You killed a friendly player! bad boy!" remoteExec["hint", _killer]};
			remoteExec["cashonKillerFunction", _killer];
		};
	}
];

Just tried this, no script errors. Also no money or message, no money from enemy players either with it.

Edit: Would it work to move the side check to the function if the _killed and _killer variables were written there too?

 

FINAL EDIT: Turns out this works, we figured out that arma was setting units side to Civ before the eventhandler would take place so we had to switch side to faction, but we have now started putting everything in  a function library. Also seems that this might not work in a multiplayer environment even with the MP added to the eventhandler and killed.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×