2015-01-12 10:24:58 +00:00
|
|
|
/*
|
|
|
|
Name: ACE_Respawn_fnc_showFriendlyFireMessages
|
2015-01-16 15:38:43 +00:00
|
|
|
|
2015-01-12 10:24:58 +00:00
|
|
|
Author(s):
|
|
|
|
commy2
|
2015-01-16 15:38:43 +00:00
|
|
|
|
2015-01-12 10:24:58 +00:00
|
|
|
Description:
|
|
|
|
shows a message in system chat of who killed who
|
2015-01-16 15:38:43 +00:00
|
|
|
|
2015-01-12 10:24:58 +00:00
|
|
|
Parameters:
|
|
|
|
0: OBJECT - unit
|
|
|
|
1: OBJECT - killer
|
2015-01-16 15:38:43 +00:00
|
|
|
|
2015-01-12 10:24:58 +00:00
|
|
|
Returns:
|
|
|
|
VOID
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
2015-01-12 09:07:03 +00:00
|
|
|
|
|
|
|
private ["_unit", "_killer"];
|
|
|
|
|
|
|
|
_unit = _this select 0;
|
|
|
|
_killer = _this select 1;
|
|
|
|
|
2015-01-12 09:49:21 +00:00
|
|
|
if (_unit != _killer && side group _unit in [side group ACE_player, civilian] && {side group _killer == side group ACE_player}) then {
|
2015-01-13 15:29:35 +00:00
|
|
|
systemChat format ["%1 was killed by %2", [_unit] call EFUNC(common,getName), [_killer] call EFUNC(common,getName)];
|
2015-01-12 09:07:03 +00:00
|
|
|
|
2015-01-16 15:38:43 +00:00
|
|
|
// Raise custom event. @todo: remove
|
2015-01-13 15:29:35 +00:00
|
|
|
[_unit, "killedByFriendly", [_unit, _killer]] call EFUNC(common,callCustomEventHandlers);
|
2015-01-16 15:38:43 +00:00
|
|
|
// Raise ACE globalEvent
|
|
|
|
["killedByFriendly", [_unit, _killer]] call EFUNC(common,globalEvent);
|
2015-01-12 09:07:03 +00:00
|
|
|
};
|