Get player name before death

Vanilla commit:

3e8c9410c5
This commit is contained in:
ebaydayz
2016-10-13 16:01:55 -04:00
parent 0b9c4a7ade
commit 7044b0095d
3 changed files with 4 additions and 3 deletions

View File

@@ -2,7 +2,6 @@ private ["_pos","_display","_body","_playerID","_array","_source","_method","_is
disableSerialization; disableSerialization;
if (deathHandled) exitWith {}; if (deathHandled) exitWith {};
deathHandled = true; deathHandled = true;
_bodyName = if (alive player) then {name player} else {"unknown"};
//Prevent client freezes //Prevent client freezes
_display = findDisplay 49; _display = findDisplay 49;
@@ -50,8 +49,8 @@ if (count _this > 0) then {
}; };
//Send Death Notice //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]; 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 _bodyName,_infected,toArray _sourceName,toArray _sourceWeapon,_distance,toArray _method]; //Send name as array to avoid publicVariable value restrictions 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"; publicVariableServer "PVDZ_plr_Death";
_id = [player,20,true,getPosATL player] call player_alertZombies; _id = [player,20,true,getPosATL player] call player_alertZombies;

View File

@@ -614,6 +614,7 @@ if (!isDedicated) then {
dayz_lastMedicalTime = 0; dayz_lastMedicalTime = 0;
dayz_lastClothesChange = 0; dayz_lastClothesChange = 0;
dayZ_lastPlayerUpdate = 0; dayZ_lastPlayerUpdate = 0;
dayz_playerName = "unknown";
dayz_hunger = 0; dayz_hunger = 0;
dayz_thirst = 0; dayz_thirst = 0;
dayz_nutrition = 0; dayz_nutrition = 0;

View File

@@ -11,6 +11,7 @@ while {true} do {
}; };
if ((!isNil "Dayz_loginCompleted") and {(Dayz_loginCompleted)}) exitWith { if ((!isNil "Dayz_loginCompleted") and {(Dayz_loginCompleted)}) exitWith {
//diag_log [ __FILE__, __LINE__, "End loop"]; //diag_log [ __FILE__, __LINE__, "End loop"];
dayz_playerName = if (alive player) then {name player} else {"unknown"};
}; };
_display = uiNameSpace getVariable "BIS_loadingScreen"; _display = uiNameSpace getVariable "BIS_loadingScreen";
if ((!isNil "_display") and {(dayz_loadScreenMsg != "" )}) then { if ((!isNil "_display") and {(dayz_loadScreenMsg != "" )}) then {