From b5ac1dd84c4d84880a461ffc9e9e05215db1ac7a Mon Sep 17 00:00:00 2001 From: McDiod Date: Tue, 15 Oct 2019 16:27:34 +0200 Subject: [PATCH] add "killfeed" --- functions/events/fn_onUnitKilledServer.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functions/events/fn_onUnitKilledServer.sqf b/functions/events/fn_onUnitKilledServer.sqf index 66df29d..2106348 100644 --- a/functions/events/fn_onUnitKilledServer.sqf +++ b/functions/events/fn_onUnitKilledServer.sqf @@ -5,11 +5,16 @@ params ["_victim",["_shooter",objNull],["_victimPos", [0,0,0]],["_victimName", " if (isNull _shooter) exitWith {}; //exit if self-kill -if (_victim == _shooter) exitWith {}; +if (_victim == _shooter) exitWith { + (format ["%1 died.",_victimName]) remoteExec ["systemChat",0,false]; +}; _victim setVariable [QEGVAR(missionSetup,deaths),(_victim getVariable [QEGVAR(missionSetup,deaths), 0]) + 1, true]; _shooter setVariable [QEGVAR(missionSetup,kills),(_shooter getVariable [QEGVAR(missionSetup,kills), 0]) + 1, true]; +private _shooterName = _shooter getVariable ["ACE_Name",name _shooter]; +(format ["%1 killed %2.",_shooterName,_victimName]) remoteExec ["systemChat",0,false]; + private _shotDistance = (getPos _shooter) distance2D _victimPos; if (_shotDistance > (_shooter getVariable [QEGVAR(missionSetup,longestKill), 0])) then { _shooter setVariable [QEGVAR(missionSetup,longestKill), _shotDistance, true];