diff --git a/SQF/dayz_code/compile/player_death.sqf b/SQF/dayz_code/compile/player_death.sqf index 00b053854..1a0ef2984 100644 --- a/SQF/dayz_code/compile/player_death.sqf +++ b/SQF/dayz_code/compile/player_death.sqf @@ -22,7 +22,7 @@ _infected = 0; if (r_player_infected && DZE_PlayerZed) then { _infected = 1; }; -PVDZE_plr_Died = [dayz_characterID,0,_body,_playerID,_infected]; +PVDZE_plr_Died = [dayz_characterID,0,_body,_playerID,_infected, dayz_playerName]; publicVariableServer "PVDZE_plr_Died"; _id = [player,20,true,getPosATL player] call player_alertZombies; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 8f18a4a27..22e9b9737 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -671,7 +671,7 @@ if(!isDedicated) then { dayz_guiHumanity = -90000; dayz_firstGroup = group player; dayz_originalPlayer = player; - dayz_playerName = "Unknown"; + dayz_playerName = name player; dayz_sourceBleeding = objNull; dayz_clientPreload = false; dayz_authed = false; diff --git a/SQF/dayz_server/compile/fnc_plyrHit.sqf b/SQF/dayz_server/compile/fnc_plyrHit.sqf index 6fa4d8706..35843aa71 100644 --- a/SQF/dayz_server/compile/fnc_plyrHit.sqf +++ b/SQF/dayz_server/compile/fnc_plyrHit.sqf @@ -4,7 +4,9 @@ _attacker = _this select 1; _damage = _this select 2; if (!isPlayer _victim || !isPlayer _attacker) exitWith {}; -if ((owner _victim) == (owner _attacker)) exitWith {}; +if ((owner _victim) == (owner _attacker)) exitWith { + _victim setVariable["AttackedBy", _victim, true]; +}; _weapon = weaponState _attacker; if (_weapon select 0 == "Throw") then diff --git a/SQF/dayz_server/compile/server_playerDied.sqf b/SQF/dayz_server/compile/server_playerDied.sqf index 1ca812c00..ecddabe73 100644 --- a/SQF/dayz_server/compile/server_playerDied.sqf +++ b/SQF/dayz_server/compile/server_playerDied.sqf @@ -5,7 +5,7 @@ _minutes = _this select 1; _newObject = _this select 2; _playerID = _this select 3; _infected = _this select 4; -_victimName = name _newObject; +_victimName = _this select 5; _victim = _newObject; _newObject setVariable ["bodyName", _victimName, true]; @@ -15,12 +15,12 @@ _killerName = _victim getVariable["AttackedByName", "nil"]; // when a zombie kills a player _killer, _killerName && _weapon will be "nil" // we can use this to determine a zombie kill && send a customized message for that. right now no killmsg means it was a zombie. -if (_killerName != "nil") then +if ((typeName _killer) != "STRING") then { _weapon = _victim getVariable["AttackedByWeapon", "nil"]; _distance = _victim getVariable["AttackedFromDistance", "nil"]; - if (_victimName == _killerName) then + if ((owner _victim) == (owner _killer)) then { _message = format["%1 killed himself",_victimName]; _loc_message = format["PKILL: %1 killed himself", _victimName];