From 7044b0095d3ac32ed1594e939919b1c4dba8d54e Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 13 Oct 2016 16:01:55 -0400 Subject: [PATCH] Get player name before death Vanilla commit: https://github.com/DayZMod/DayZ/commit/3e8c9410c5419f76b545d57fe42a51ce2883b326 --- SQF/dayz_code/compile/player_death.sqf | 5 ++--- SQF/dayz_code/init/variables.sqf | 1 + SQF/dayz_code/system/progress_monitor.sqf | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SQF/dayz_code/compile/player_death.sqf b/SQF/dayz_code/compile/player_death.sqf index a0fe2f8a6..b0ac6e993 100644 --- a/SQF/dayz_code/compile/player_death.sqf +++ b/SQF/dayz_code/compile/player_death.sqf @@ -2,7 +2,6 @@ private ["_pos","_display","_body","_playerID","_array","_source","_method","_is disableSerialization; if (deathHandled) exitWith {}; deathHandled = true; -_bodyName = if (alive player) then {name player} else {"unknown"}; //Prevent client freezes _display = findDisplay 49; @@ -50,8 +49,8 @@ if (count _this > 0) then { }; //Send Death Notice -diag_log format["Player_Death: Body:%1 BodyName:%2 Infected:%3 SourceName:%4 SourceWeapon:%5 Distance:%6 Method:%7",_body,_bodyName,_infected,_sourceName,_sourceWeapon,_distance,_method]; -PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,toArray _bodyName,_infected,toArray _sourceName,toArray _sourceWeapon,_distance,toArray _method]; //Send name as array to avoid publicVariable value restrictions +diag_log format["Player_Death: Body:%1 BodyName:%2 Infected:%3 SourceName:%4 SourceWeapon:%5 Distance:%6 Method:%7",_body,dayz_playerName,_infected,_sourceName,_sourceWeapon,_distance,_method]; +PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,toArray dayz_playerName,_infected,toArray _sourceName,toArray _sourceWeapon,_distance,toArray _method]; //Send name as array to avoid publicVariable value restrictions publicVariableServer "PVDZ_plr_Death"; _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 82336cf79..c41365add 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -614,6 +614,7 @@ if (!isDedicated) then { dayz_lastMedicalTime = 0; dayz_lastClothesChange = 0; dayZ_lastPlayerUpdate = 0; + dayz_playerName = "unknown"; dayz_hunger = 0; dayz_thirst = 0; dayz_nutrition = 0; diff --git a/SQF/dayz_code/system/progress_monitor.sqf b/SQF/dayz_code/system/progress_monitor.sqf index 23cb1bcde..4d9c7f322 100644 --- a/SQF/dayz_code/system/progress_monitor.sqf +++ b/SQF/dayz_code/system/progress_monitor.sqf @@ -11,6 +11,7 @@ while {true} do { }; if ((!isNil "Dayz_loginCompleted") and {(Dayz_loginCompleted)}) exitWith { //diag_log [ __FILE__, __LINE__, "End loop"]; + dayz_playerName = if (alive player) then {name player} else {"unknown"}; }; _display = uiNameSpace getVariable "BIS_loadingScreen"; if ((!isNil "_display") and {(dayz_loadScreenMsg != "" )}) then {