Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Freddywall

Display teamkill

Recommended Posts

Hello guys i'am new at scripting. I'am trying to write script which will display some text if player kill his teammate. I tried use EH killed for this, but it's doesn't work. 

//InitPlayerLocal.sqf
player addEventHandler ["Killed", {
    params ["_unit", "_killer", "_instigator", "_useEffects"];
if (side _killer == side _unit) then {hint "teamkill";} else {hint "not teamkill";};
}];

Share this post


Link to post
Share on other sites
3 minutes ago, Freddywall said:

Hello guys i'am new at scripting. I'am trying to write script which will display some text if player kill his teammate. I tried use EH killed for this, but it's doesn't work. 

Killed Event Handler is fired when the unit that assigned is killed. In this case, it will fire when the player is killed.

Use EntityKilled Mission Event Handler instead.

addMissionEventHandler ["EntityKilled", {
	params ["_unit","_killer"];
	if (side _unit == side _killer and _killer == player) then {
		hint "teamkill";
	} else {
		hint "not teamkill";
	};
}];

(not tested)

Share this post


Link to post
Share on other sites
Sign in to follow this  

×