Skip to content

Commit

Permalink
add "killfeed"
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed Oct 15, 2019
1 parent 2bdd25b commit b5ac1dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion functions/events/fn_onUnitKilledServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit b5ac1dd

Please sign in to comment.