mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-15 13:26:39 +03:00
Send dayz_playerName as array
This avoids triggering PV value restrictions when the player has keywords or special characters in their name.
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
private ["_display","_body","_playerID","_array","_source","_method","_canHitFree","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup"];
|
||||
private ["_display","_body","_playerID","_array","_source","_method","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup"];
|
||||
disableSerialization;
|
||||
if (deathHandled) exitWith {};
|
||||
deathHandled = true;
|
||||
if ((alive player) && {isNil {dayz_playerName}}) then {
|
||||
dayz_playerName = name player;
|
||||
};
|
||||
if (alive player) then {dayz_playerName = name player;};
|
||||
|
||||
//Prevent client freezes
|
||||
_display = findDisplay 49;
|
||||
if(!isNull _display) then {_display closeDisplay 0;};
|
||||
if (!isNull _display) then {_display closeDisplay 0;};
|
||||
if (dialog) then {closeDialog 0;};
|
||||
if (visibleMap) then {openMap false;};
|
||||
|
||||
_body = player;
|
||||
_playerID = [player] call FNC_GetPlayerUID;
|
||||
|
||||
disableUserInput true;
|
||||
|
||||
//add weapon on back to player...
|
||||
if (dayz_onBack != "") then {
|
||||
//Add weapon on back to body.
|
||||
@@ -28,19 +27,13 @@ if (dayz_onBack != "") then {
|
||||
_item addWeaponCargoGlobal [dayz_onBack,1];
|
||||
*/
|
||||
};
|
||||
_infected = 0;
|
||||
if (r_player_infected && DZE_PlayerZed) then {
|
||||
_infected = 1;
|
||||
};
|
||||
_infected = if (r_player_infected && DZE_PlayerZed) then {1} else {0};
|
||||
//Send Death Notice
|
||||
//["PVDZ_plr_Death",[dayz_characterID,0,_body,_playerID,dayz_playerName]] call callRpcProcedure;
|
||||
PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,_infected,dayz_playerName];
|
||||
PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID,_infected,toArray dayz_playerName]; // Send as array to avoid publicVariable value restrictions
|
||||
publicVariableServer "PVDZ_plr_Death";
|
||||
|
||||
_id = [player,20,true,getPosATL player] call player_alertZombies;
|
||||
|
||||
uiSleep 0.5;
|
||||
|
||||
player setDamage 1;
|
||||
0.1 fadeSound 0;
|
||||
|
||||
@@ -49,7 +42,7 @@ player setVariable ["unconsciousTime", 0, true];
|
||||
player setVariable ["USEC_isCardiac",false,true];
|
||||
player setVariable ["medForceUpdate",true,true];
|
||||
player setVariable ["bloodTaken", false, true];
|
||||
player setVariable ["startcombattimer", 0];
|
||||
player setVariable ["startcombattimer", 0]; //remove combat timer on death
|
||||
r_player_unconscious = false;
|
||||
r_player_cardiac = false;
|
||||
_model = typeOf player;
|
||||
@@ -60,13 +53,21 @@ if (count _array > 0) then {
|
||||
_source = _array select 0;
|
||||
_method = _array select 1;
|
||||
if ((!isNull _source) && (_source != player)) then {
|
||||
_canHitFree = player getVariable ["freeTarget",false];
|
||||
_isBandit = (player getVariable["humanity",0]) <= -2000;
|
||||
_punishment = _canHitFree || _isBandit; //if u are bandit || start first - player will not recieve humanity drop
|
||||
//_isBandit = (_model in ["Bandit1_DZ","BanditW1_DZ"]);
|
||||
|
||||
//if you are a bandit or start first - player will not recieve humanity drop
|
||||
_punishment =
|
||||
_isBandit ||
|
||||
{player getVariable ["OpenTarget",false]};
|
||||
_humanityHit = 0;
|
||||
|
||||
if (!_punishment) then {
|
||||
//i'm "not guilty" - kill me && be punished
|
||||
_myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
|
||||
//i'm "not guilty" - kill me and be punished
|
||||
_myKills = ((player getVariable ["humanKills",0]) / 3) * 1500;
|
||||
// how many non bandit players have I (the dead player) killed?
|
||||
// punish my killer 2000 for shooting a surivor
|
||||
// but subtract 500 for each survivor I've murdered
|
||||
_humanityHit = -(2000 - _myKills);
|
||||
_kills = _source getVariable ["humanKills",0];
|
||||
_source setVariable ["humanKills",(_kills + 1),true];
|
||||
@@ -107,47 +108,37 @@ if (count _array > 0) then {
|
||||
|
||||
terminate dayz_musicH;
|
||||
terminate dayz_slowCheck;
|
||||
//terminate dayz_animalCheck;
|
||||
terminate dayz_monitor1;
|
||||
//terminate dayz_medicalH;
|
||||
|
||||
//Reset (just in case)
|
||||
//deleteVehicle dayz_playerTrigger;
|
||||
//disableUserInput false;
|
||||
r_player_dead = true;
|
||||
|
||||
"dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [4]; "dynamicBlur" ppEffectCommit 0.2;
|
||||
|
||||
"colorCorrections" ppEffectEnable true;
|
||||
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.01], [1, 1, 1, 0.0]];
|
||||
"colorCorrections" ppEffectCommit 1;
|
||||
|
||||
//Player is Dead!
|
||||
3 fadeSound 0;
|
||||
uiSleep 1;
|
||||
|
||||
dayz_originalPlayer enableSimulation true;
|
||||
|
||||
addSwitchableUnit dayz_originalPlayer;
|
||||
setPlayable dayz_originalPlayer;
|
||||
selectPlayer dayz_originalPlayer;
|
||||
|
||||
//_myGroup = group _body;
|
||||
//[_body] joinSilent dayz_firstGroup;
|
||||
//deleteGroup _myGroup;
|
||||
_myGroup = group _body;
|
||||
[_body] joinSilent dayz_firstGroup;
|
||||
deleteGroup _myGroup;
|
||||
|
||||
3 cutRsc ["default", "PLAIN",3];
|
||||
4 cutRsc ["default", "PLAIN",3];
|
||||
|
||||
_body setVariable["combattimeout", 0, true];
|
||||
|
||||
//["dayzFlies",player] call broadcastRpcCallAll;
|
||||
//due to a cleanup issue with effects this has been disabled remember to look at the cleanup before adding it back.
|
||||
//[_body] call spawn_flies;
|
||||
//dayzFlies = player;
|
||||
//publicVariable "dayzFlies";
|
||||
uiSleep 2;
|
||||
|
||||
1 cutRsc ["DeathScreen","BLACK OUT",3];
|
||||
|
||||
playMusic "dayz_track_death_1";
|
||||
|
||||
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
|
||||
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
|
||||
|
||||
uiSleep 2;
|
||||
|
||||
for "_x" from 5 to 1 step -1 do {
|
||||
@@ -158,4 +149,4 @@ for "_x" from 5 to 1 step -1 do {
|
||||
PVDZ_Server_Simulation = [_body, false];
|
||||
publicVariableServer "PVDZ_Server_Simulation";
|
||||
|
||||
endMission "END1";
|
||||
endMission "END1";
|
||||
Reference in New Issue
Block a user