Split player_death into scheduled and unscheduled #1833

Death message was sometimes showing incorrectly due to spawn delay.

Also the sched_corpses two minute loop was occasionally deleting bodies
right away because bodyName setVariable was delayed by the time it took
PVDZ_plr_death to send (up to a few seconds). See #1825
This commit is contained in:
ebaydayz
2016-12-28 16:16:39 -05:00
parent b807648cc6
commit d509c15c82
12 changed files with 147 additions and 149 deletions

View File

@@ -16,6 +16,8 @@
[FIXED] M24 ammo prices are now 1/4 of DMR ammo prices, so no profit can be made by combining M24 rounds. @looter809 @ebayShopper [FIXED] M24 ammo prices are now 1/4 of DMR ammo prices, so no profit can be made by combining M24 rounds. @looter809 @ebayShopper
[FIXED] Full cinderblock walls now work properly with vector building #1813. @DeVloek @icomrade [FIXED] Full cinderblock walls now work properly with vector building #1813. @DeVloek @icomrade
[FIXED] Death message showing incorrectly when players suicide under certain conditions. @oiad @ebayShopper [FIXED] Death message showing incorrectly when players suicide under certain conditions. @oiad @ebayShopper
[FIXED] Death message sometimes showing incorrectly due to spawn delay. #1833 @schwanzkopfhegel @ebayShopper
[FIXED] Corpses occasionally being deleted right away due to delay between PVS and bodyName setVariable. #1825 @ebayShopper
[FIXED] WoodenArrow and other WeaponHolderBase inherited objects catching fire when destroyed due to destrType. #1815 @DeVloek @ebayShopper [FIXED] WoodenArrow and other WeaponHolderBase inherited objects catching fire when destroyed due to destrType. #1815 @DeVloek @ebayShopper
[FIXED] Arrows floating in air when shot at same position against a wall multiple times. #1815 @DeVloek @ebayShopper [FIXED] Arrows floating in air when shot at same position against a wall multiple times. #1815 @DeVloek @ebayShopper
[FIXED] Swimming in ground glitch when relogging at certain positions on certain maps like Napf and Tavi. @ebayShopper [FIXED] Swimming in ground glitch when relogging at certain positions on certain maps like Napf and Tavi. @ebayShopper

View File

@@ -409,7 +409,7 @@ if (_type == 1) then {
if (_damage > 4) then { if (_damage > 4) then {
//serious ballistic damage //serious ballistic damage
if (_unit == player) then { if (_unit == player) then {
_id = [_source,"explosion",_ammo] spawn player_death; [_source,"explosion",_ammo] call player_death;
}; };
} else { } else {
if (_damage > 2) then { if (_damage > 2) then {
@@ -429,7 +429,7 @@ if (_type == 2) then {
if (_damage > 4) then { if (_damage > 4) then {
//serious ballistic damage //serious ballistic damage
if (_unit == player) then { if (_unit == player) then {
_id = [_source,"shotheavy"] spawn player_death; [_source,"shotheavy"] call player_death;
}; };
} else { } else {
if (_damage > 2) then { if (_damage > 2) then {

View File

@@ -2,7 +2,7 @@
DayZ Epoch anti wall DayZ Epoch anti wall
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com. Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/ */
private ["_vehicle","_vehiclePos","_playerPos","_activated","_id","_intersectsWith"]; private ["_vehicle","_vehiclePos","_playerPos","_activated","_intersectsWith"];
_activated = false; _activated = false;
_vehicle = _this; _vehicle = _this;
@@ -40,7 +40,7 @@ if(_activated) then {
call { call {
if (DZE_AntiWallCounter == DZE_AntiWallLimit) exitWith { if (DZE_AntiWallCounter == DZE_AntiWallLimit) exitWith {
localize "str_epoch_player_9" call dayz_rollingMessages; localize "str_epoch_player_9" call dayz_rollingMessages;
_id = [player,"crushed"] spawn player_death; [player,"crushed"] call player_death;
}; };
if ((_vehicle emptyPositions "driver") > 0) exitWith { if ((_vehicle emptyPositions "driver") > 0) exitWith {
localize "STR_EPOCH_ACTIONS_15" call dayz_rollingMessages; localize "STR_EPOCH_ACTIONS_15" call dayz_rollingMessages;
@@ -64,7 +64,7 @@ if(_activated) then {
}; };
// kill player if none of the above are matched // kill player if none of the above are matched
localize "str_epoch_player_9" call dayz_rollingMessages; localize "str_epoch_player_9" call dayz_rollingMessages;
_id = [player,"crushed"] spawn player_death; [player,"crushed"] call player_death;
}; };
} else { } else {

View File

@@ -1,57 +1,42 @@
private ["_pos","_display","_body","_playerID","_array","_source","_method","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup","_model","_infected","_distance","_sourceVehicleType","_sourceWeapon","_sourceName","_ammo"]; //SetDamage immediately so Arma registers the player as dead.
disableSerialization;
if (count _this == 0) then {
//Spawned from Killed EH (engine death), this should be rare
//Wait to see if sched_medical 1s loop spawns with _source and _method (blood<=0 death)
uiSleep 1;
};
if (deathHandled) exitWith {}; if (deathHandled) exitWith {};
deathHandled = true; deathHandled = true;
player setDamage 1;
//Prevent client freezes private ["_ammo","_body","_distance","_infected","_playerID","_sourceName","_sourceWeapon","_sourceVehicleType","_isBandit","_punishment","_humanityHit","_myKills","_kills","_killsV"];
_display = findDisplay 49;
if (!isNull _display) then {_display closeDisplay 0;};
if (dialog) then {closeDialog 0;};
if (visibleMap) then {openMap false;};
_body = player; _body = player;
_playerID = getPlayerUID player; _playerID = getPlayerUID player;
disableUserInput true;
//add weapon on back to player
if (dayz_onBack != "") then { if (dayz_onBack != "") then {
//Add weapon on back to body.
_body addWeapon dayz_onBack; _body addWeapon dayz_onBack;
/*
//Add weapon on back to the ground.
_pos = _body modeltoWorld [1,1,0];
//_pos set [2, 0];
_item = createVehicle ["WeaponHolder", _pos, [], 0.0, "CAN_COLLIDE"];
_item setPosATL [_pos select 0, _pos select 1, ((_pos select 2) + 0.1)];
_item addWeaponCargoGlobal [dayz_onBack,1];
*/
}; };
//Get killer information immediately. Weapon, distance or vehicle can change in seconds.
_infected = if (r_player_infected && DZE_PlayerZed) then {1} else {0}; _infected = if (r_player_infected && DZE_PlayerZed) then {1} else {0};
_method = "unknown";
_sourceName = "unknown"; _sourceName = "unknown";
_sourceWeapon = ""; _sourceWeapon = "";
_distance = 0; _distance = 0;
if (count _this > 0) then {
_source = _this select 0; _source = if (typeName (_this select 0) == "ARRAY") then {(_this select 0) select 1} else {_this select 0};
_method = _this select 1; _method = switch true do {
_ammo = if (count _this > 2) then {_this select 2} else {""}; case (_this select 1 != "find"): {_this select 1}; //Manually passed method
case (dayz_lastDamageSource != "none" && diag_tickTime - dayz_lastDamageTime < 30): {dayz_lastDamageSource}; //Major event takes priority for cause of death (shot, fell, crash, etc.)
if (!isNull _source) then { case (dayz_lastMedicalSource != "none" && diag_tickTime - dayz_lastMedicalTime < 10): {dayz_lastMedicalSource}; //Starve, Dehyd, Sick
if (!isNull _body) then {_distance = round (_body distance _source);}; default {"bled"}; //No other damage sources in last 30 seconds
_sourceVehicleType = typeOf (vehicle _source); };
_sourceWeapon = if (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship") then {_sourceVehicleType} else {currentWeapon _source}; _ammo = if (count _this > 2) then {_this select 2} else {""};
if (_sourceWeapon == "Throw") then {_sourceWeapon = (weaponState _source) select 3;};
if (_ammo in ["PipeBomb","Mine","MineE"]) then {_sourceWeapon = _ammo;}; if (!isNull _source) then {
if (alive _source) then { if (!isNull _body) then {_distance = round (_body distance _source);};
_sourceName = if (isPlayer _source) then {name _source} else {localize "STR_PLAYER_AI"}; _sourceVehicleType = typeOf (vehicle _source);
}; _sourceWeapon = if (_sourceVehicleType isKindOf "LandVehicle" or _sourceVehicleType isKindOf "Air" or _sourceVehicleType isKindOf "Ship") then {_sourceVehicleType} else {currentWeapon _source};
if (_source == _body) then {_sourceName = dayz_playerName;}; if (_sourceWeapon == "Throw") then {_sourceWeapon = (weaponState _source) select 3;};
if (_ammo in ["PipeBomb","Mine","MineE"]) then {_sourceWeapon = _ammo;};
if (alive _source) then {
_sourceName = if (isPlayer _source) then {name _source} else {localize "STR_PLAYER_AI"};
}; };
if (_source == _body) then {_sourceName = dayz_playerName;};
}; };
//Send Death Notice //Send Death Notice
@@ -59,100 +44,108 @@ diag_log format["Player_Death: Body:%1 BodyName:%2 Infected:%3 SourceName:%4 Sou
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 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; _body setVariable ["deathType",_method,true];
uiSleep 0.5;
player setDamage 1;
if (dayz_soundMuted) then {call player_toggleSoundMute;}; // hide icon before fadeSound
0.1 fadeSound 0;
player setVariable ["NORRN_unconscious", false, true]; if (!local _source && isPlayer _source) then {
player setVariable ["unconsciousTime", 0, true]; _isBandit = (player getVariable["humanity",0]) <= -2000;
player setVariable ["USEC_isCardiac",false,true]; //_isBandit = (typeOf player in ["Bandit1_DZ","BanditW1_DZ"]);
player setVariable ["medForceUpdate",true,true];
player setVariable ["bloodTaken", false, true]; //if you are a bandit or start first - player will not recieve humanity drop
player setVariable ["startcombattimer", 0]; //remove combat timer on death _punishment = ((_isBandit or {player getVariable ["OpenTarget",false]}) && !(player isKindOf "PZombie_VB"));
player setVariable ["inCombat", false, true]; _humanityHit = 0;
r_player_unconscious = false;
r_player_cardiac = false;
_model = typeOf player;
dayz_autoRun = false;
_array = _this; if (!_punishment) then {
if (count _array > 0) then { //I'm "not guilty" - kill me and be punished
_source = _array select 0; _myKills = (player getVariable ["humanKills",0]) * 33.3;
_method = _array select 1; // how many non bandit players have I (the dead player) killed?
if (!local _source && isPlayer _source) then { // punish my killer 2000 for shooting a surivor
_isBandit = (player getVariable["humanity",0]) <= -2000; // but subtract 500 for each survivor I've murdered
//_isBandit = (_model in ["Bandit1_DZ","BanditW1_DZ"]); _humanityHit = -(2000 - _myKills);
_kills = _source getVariable ["humanKills",0];
//if you are a bandit or start first - player will not recieve humanity drop _source setVariable ["humanKills",(_kills + 1),true];
_punishment = ((_isBandit or {player getVariable ["OpenTarget",false]}) && !(player isKindOf "PZombie_VB")); PVDZ_send = [_source,"Humanity",[_humanityHit,300]];
_humanityHit = 0; publicVariableServer "PVDZ_send";
} else {
if (!_punishment) then { //i'm "guilty" - kill me as bandit
//I'm "not guilty" - kill me and be punished _killsV = _source getVariable ["banditKills",0];
_myKills = (player getVariable ["humanKills",0]) * 33.3; _source setVariable ["banditKills",(_killsV + 1),true];
// 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];
PVDZ_send = [_source,"Humanity",[_humanityHit,300]];
publicVariableServer "PVDZ_send";
} else {
//i'm "guilty" - kill me as bandit
_killsV = _source getVariable ["banditKills",0];
_source setVariable ["banditKills",(_killsV + 1),true];
};
//Setup for study bodys.
_body setVariable ["KillingBlow",[_source,_punishment],true];
}; };
_body setVariable ["deathType",_method,true];
//Setup for study bodys.
_body setVariable ["KillingBlow",[_source,_punishment],true];
}; };
terminate dayz_musicH; [] spawn {
terminate dayz_slowCheck; private ["_display","_body","_myGroup"];
terminate dayz_monitor1; disableSerialization;
//Reset (just in case) //Prevent client freezes
//deleteVehicle dayz_playerTrigger; _display = findDisplay 49;
//disableUserInput false; if (!isNull _display) then {_display closeDisplay 0;};
r_player_dead = true; if (dialog) then {closeDialog 0;};
if (visibleMap) then {openMap false;};
//Player is dead! _body = player;
3 fadeSound 0; disableUserInput true;
uiSleep 1;
dayz_originalPlayer enableSimulation true; _id = [player,20,true,getPosATL player] call player_alertZombies;
addSwitchableUnit dayz_originalPlayer; uiSleep 0.5;
setPlayable dayz_originalPlayer; if (dayz_soundMuted) then {call player_toggleSoundMute;}; // hide icon before fadeSound
selectPlayer dayz_originalPlayer; 0.1 fadeSound 0;
_myGroup = group _body; player setVariable ["NORRN_unconscious", false, true];
[_body] joinSilent dayz_firstGroup; player setVariable ["unconsciousTime", 0, true];
deleteGroup _myGroup; player setVariable ["USEC_isCardiac",false,true];
80000 cutText ["","PLAIN"]; //Clear group icons player setVariable ["medForceUpdate",true,true];
player setVariable ["bloodTaken", false, true];
player setVariable ["startcombattimer", 0]; //remove combat timer on death
player setVariable ["inCombat", false, true];
r_player_unconscious = false;
r_player_cardiac = false;
dayz_autoRun = false;
3 cutRsc ["default", "PLAIN",3]; terminate dayz_musicH;
4 cutRsc ["default", "PLAIN",3]; terminate dayz_slowCheck;
terminate dayz_monitor1;
_body setVariable["combattimeout", 0, true]; //Reset (just in case)
//due to a cleanup issue with effects this has been disabled remember to look at the cleanup before adding it back. //deleteVehicle dayz_playerTrigger;
//dayzFlies = player; //disableUserInput false;
//publicVariable "dayzFlies"; r_player_dead = true;
uiSleep 2;
1 cutRsc [if (DZE_DeathScreen) then {"DeathScreen_DZE"} else {"DeathScreen_DZ"},"BLACK OUT",3];
playMusic "dayz_track_death_1";
uiSleep 2;
for "_x" from 5 to 1 step -1 do { //Player is dead!
titleText [format[localize "str_return_lobby", _x], "PLAIN DOWN", 1]; 3 fadeSound 0;
uiSleep 1; uiSleep 1;
};
PVDZ_Server_Simulation = [_body, false]; dayz_originalPlayer enableSimulation true;
publicVariableServer "PVDZ_Server_Simulation"; addSwitchableUnit dayz_originalPlayer;
setPlayable dayz_originalPlayer;
selectPlayer dayz_originalPlayer;
endMission "END1"; _myGroup = group _body;
[_body] joinSilent dayz_firstGroup;
deleteGroup _myGroup;
80000 cutText ["","PLAIN"]; //Clear group icons
3 cutRsc ["default", "PLAIN",3];
4 cutRsc ["default", "PLAIN",3];
_body setVariable["combattimeout", 0, true];
//due to a cleanup issue with effects this has been disabled remember to look at the cleanup before adding it back.
//dayzFlies = player;
//publicVariable "dayzFlies";
uiSleep 2;
1 cutRsc [if (DZE_DeathScreen) then {"DeathScreen_DZE"} else {"DeathScreen_DZ"},"BLACK OUT",3];
playMusic "dayz_track_death_1";
uiSleep 2;
for "_x" from 5 to 1 step -1 do {
titleText [format[localize "str_return_lobby", _x], "PLAIN DOWN", 1];
uiSleep 1;
};
PVDZ_Server_Simulation = [_body, false];
publicVariableServer "PVDZ_Server_Simulation";
endMission "END1";
};

View File

@@ -8,7 +8,7 @@ fnc_usec_damageHandle = {
_unit = _this select 0; _unit = _this select 0;
mydamage_eh1 = _unit addeventhandler ["HandleDamage",{_this call fnc_usec_damageHandler;} ]; mydamage_eh1 = _unit addeventhandler ["HandleDamage",{_this call fnc_usec_damageHandler;} ];
mydamage_eh2 = _unit addEventHandler ["Fired", {_this call player_fired;}]; mydamage_eh2 = _unit addEventHandler ["Fired", {_this call player_fired;}];
mydamage_eh3 = _unit addEventHandler ["Killed", {_id = [] spawn player_death;}]; mydamage_eh3 = _unit addEventHandler ["Killed", {[_this,"find"] call player_death;}];
}; };
fnc_usec_pitchWhine = { fnc_usec_pitchWhine = {

View File

@@ -33,7 +33,7 @@ BIS_Effects_startEvent = {
} count DZE_SafeZonePosArray; } count DZE_SafeZonePosArray;
player action ["getOut", (_this select 0)]; player action ["getOut", (_this select 0)];
if (!_cancel && {!((_this select 0) iskindof "car")}) then { if (!_cancel && {!((_this select 0) iskindof "car")}) then {
[player, "explosion"] spawn player_death; [player, "explosion"] call player_death;
}; };
}; };
}; };

View File

@@ -230,7 +230,7 @@ while {1 == 1} do {
}; };
_result = r_player_blood - _bloodloss; _result = r_player_blood - _bloodloss;
if (_result < 0) then { if (_result < 0) then {
_id = [player,"rad"] spawn player_death; [player,"rad"] call player_death;
} else { } else {
r_player_blood = _result; r_player_blood = _result;
}; };

View File

@@ -18,7 +18,7 @@ sched_medical_slow = { // 10 seconds
sched_medical_init = { [ []spawn{} ] }; sched_medical_init = { [ []spawn{} ] };
sched_medical = { // 1 second sched_medical = { // 1 second
HIDE_FSM_VARS HIDE_FSM_VARS
private ["_method","_unconHdlr"]; private "_unconHdlr";
_unconHdlr = _this select 0; _unconHdlr = _this select 0;
if (r_player_blood == 12000) then { if (r_player_blood == 12000) then {
@@ -27,14 +27,8 @@ sched_medical = { // 1 second
//r_player_unconscious = getVariable ["NORRN_unconscious", true]; //r_player_unconscious = getVariable ["NORRN_unconscious", true];
_method = switch (true) do {
case (dayz_lastDamageSource != "none" && diag_tickTime - dayz_lastDamageTime < 30): {dayz_lastDamageSource}; //Major event takes priority for cause of death
case (dayz_lastMedicalSource != "none" && diag_tickTime - dayz_lastMedicalTime < 10): {dayz_lastMedicalSource}; //Starve, Dehyd, Sick
default {"bled"}; //No other damage sources in last 30 seconds
};
if (r_player_blood <= 0) then { if (r_player_blood <= 0) then {
[dayz_sourceBleeding, _method] spawn player_death; [dayz_sourceBleeding,"find"] call player_death;
}; };
if (!canStand player) then { // be consistant with player_updateGui.sqf if (!canStand player) then { // be consistant with player_updateGui.sqf

View File

@@ -1,7 +1,6 @@
/* /*
WARNING: The player object is deleted by Arma shortly after onPlayerDisconnected fires WARNING: Alive player objects are deleted by Arma shortly after onPlayerDisconnected fires
because DayZ uses disabledAI=true: because DayZ uses disabledAI=1 https://community.bistudio.com/wiki/Description.ext#disabledAI
https://community.bistudio.com/wiki/Description.ext#disabledAI
References to the player object after that point will return objNull, so this function References to the player object after that point will return objNull, so this function
and server_playerSync must be fast or the player will not save. and server_playerSync must be fast or the player will not save.
@@ -12,14 +11,14 @@ _playerUID = _this select 0;
_playerName = _this select 1; _playerName = _this select 1;
_playerObj = nil; _playerObj = nil;
//Lets search all playerable units looking for the objects that matches our playerUID //Lets search all players looking for the object that matches our UID
{ {
if ((getPlayerUID _x) == _playerUID) exitWith { _playerObj = _x; _playerPos = getPosATL _playerObj;}; if ((getPlayerUID _x) == _playerUID) exitWith { _playerObj = _x; _playerPos = getPosATL _playerObj;};
} count playableUnits; } count playableUnits;
//If for some reason the playerOBj does not exist lets exit the disconnect system. //If playerObj is not in playableUnits then lets exit the disconnect system.
if (isNil "_playerObj") exitWith { if (isNil "_playerObj") exitWith {
diag_log format["%1: nil player object, _this:%2", __FILE__, _this]; diag_log format["%1: Player object is not in playableUnits. This is normal if the player just died. _this:%2", __FILE__, _this];
}; };
//diag_log format["get: %1 (%2), sent: %3 (%4)",typeName (getPlayerUID _playerObj), getPlayerUID _playerObj, typeName _playerUID, _playerUID]; //diag_log format["get: %1 (%2), sent: %3 (%4)",typeName (getPlayerUID _playerObj), getPlayerUID _playerObj, typeName _playerUID, _playerUID];
@@ -31,7 +30,8 @@ _inCombat = _playerObj getVariable ["inCombat",false];
_Sepsis = _playerObj getVariable["USEC_Sepsis",false]; _Sepsis = _playerObj getVariable["USEC_Sepsis",false];
//Login processing do not sync //Login processing do not sync
if (_playerUID in dayz_ghostPlayers) exitwith { if (_playerUID in dayz_ghostPlayers) exitWith {
//Note player is alive (see set in dayz_ghostPlayers below)
diag_log format["ERROR: Cannot Sync Character [%1,%2] Still processing login",_playerName,_playerUID]; diag_log format["ERROR: Cannot Sync Character [%1,%2] Still processing login",_playerName,_playerUID];
//Lets remove the object. //Lets remove the object.
@@ -81,7 +81,7 @@ if (_characterID != "?") then {
{[_x,"gear"] call server_updateObject} count (nearestObjects [_playerPos,DayZ_GearedObjects,10]); {[_x,"gear"] call server_updateObject} count (nearestObjects [_playerPos,DayZ_GearedObjects,10]);
}; };
[_playerUID,_characterID,3,_playerName,((getPosATL _playerObj) call fa_coor2str)] call dayz_recordLogin; [_playerUID,_characterID,3,_playerName,(_playerPos call fa_coor2str)] call dayz_recordLogin;
}; };
if (alive _playerObj) then { if (alive _playerObj) then {

View File

@@ -63,6 +63,7 @@ if (_playerName != "unknown" or _sourceName != "unknown") then {
if (toLower DZE_DeathMsgChat != "none" or DZE_DeathMsgRolling or DZE_DeathMsgDynamicText) then { if (toLower DZE_DeathMsgChat != "none" or DZE_DeathMsgRolling or DZE_DeathMsgDynamicText) then {
PVDZE_deathMessage = _message; PVDZE_deathMessage = _message;
//Don't use regular PV here since JIP clients don't need it //Don't use regular PV here since JIP clients don't need it
owner _newObject publicVariableClient "PVDZE_deathMessage"; //Send to dead player (not in playableUnits)
{ {
if (isPlayer _x) then { if (isPlayer _x) then {
owner _x publicVariableClient "PVDZE_deathMessage"; owner _x publicVariableClient "PVDZE_deathMessage";

View File

@@ -41,8 +41,8 @@ sched_corpses = {
} else { } else {
//Only spawn flies on actual dead player, otherwise delete the body (clean up left over ghost from relogging, sometimes it is not deleted automatically by Arma or onPlayerDisconnect) //Only spawn flies on actual dead player, otherwise delete the body (clean up left over ghost from relogging, sometimes it is not deleted automatically by Arma or onPlayerDisconnect)
//AI mods will need to setVariable "bodyName" on their dead units to prevent them being cleaned up //AI mods will need to setVariable "bodyName" on their dead units to prevent them being cleaned up
_deathTime = _x getVariable ["sched_co_deathTime", -1];
if (_x getVariable["bodyName",""] != "") then { if (_x getVariable["bodyName",""] != "") then {
_deathTime = _x getVariable ["sched_co_deathTime", -1];
if (_deathTime == -1) then { if (_deathTime == -1) then {
_deathPos = _x getVariable ["deathPos",respawn_west_original]; _deathPos = _x getVariable ["deathPos",respawn_west_original];
/*_cpos = getPosATL _x; /*_cpos = getPosATL _x;
@@ -101,8 +101,16 @@ sched_corpses = {
publicVariable "PVCDZ_flies"; publicVariable "PVCDZ_flies";
}; };
} else { } else {
_x call sched_co_deleteVehicle; if (_deathTime == -1) then {
_delQtyG = _delQtyG + 1; _deathTime = diag_tickTime;
_x setVariable ["sched_co_deathTime", _deathTime];
} else {
// Wait 30s to make sure the server had time to setVariable "bodyName". PVDZ_plr_Death can be delayed by a few seconds.
if (diag_tickTime - _deathTime > 30) then {
_x call sched_co_deleteVehicle;
_delQtyG = _delQtyG + 1;
};
};
}; };
}; };
}; };

View File

@@ -30,7 +30,7 @@
5 playableUnits !"for [{_y=0},{_y < count(playableUnits)},{_y=_y+1}] do {" !"typeName player == \"OBJECT\")}) AND {((player in playableUnits) AND {(alive player)" !"(1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {" !"AND {((alive _x) AND {((vehicle _x) distance _obj < 150)})}} count playableUnits)}) then {" !="_local = { _unit distance _x < _dis; } count playableUnits <= 1;" !"if (!_isOk) exitWith {false};\nuiSleep 0.001;\n} forEach playableUnits;" !"ManagementMustBeClose) then { player nearEntities [\"CAManBase\", 10] } else { playableUnits };" 5 playableUnits !"for [{_y=0},{_y < count(playableUnits)},{_y=_y+1}] do {" !"typeName player == \"OBJECT\")}) AND {((player in playableUnits) AND {(alive player)" !"(1 max count playableUnits)) min (dayz_maxAnimals - _count))) to 1 step -1 do {" !"AND {((alive _x) AND {((vehicle _x) distance _obj < 150)})}} count playableUnits)}) then {" !="_local = { _unit distance _x < _dis; } count playableUnits <= 1;" !"if (!_isOk) exitWith {false};\nuiSleep 0.001;\n} forEach playableUnits;" !"ManagementMustBeClose) then { player nearEntities [\"CAManBase\", 10] } else { playableUnits };"
5 selectPlayer !"dayz_originalPlayer enableSimulation true;\naddSwitchableUnit dayz_originalPlayer;\nsetPlayable dayz_originalPlayer;\nselectPlayer dayz_originalPlayer;" !"addSwitchableUnit _newUnit;\nsetPlayable _newUnit;\nselectPlayer _newUnit;" 5 selectPlayer !"dayz_originalPlayer enableSimulation true;\naddSwitchableUnit dayz_originalPlayer;\nsetPlayable dayz_originalPlayer;\nselectPlayer dayz_originalPlayer;" !"addSwitchableUnit _newUnit;\nsetPlayable _newUnit;\nselectPlayer _newUnit;"
5 serverCommand !="_character = if (serverCommandAvailable \"#kick\") then { call sched_tg_follow } else { player };" !"serverCommand (\"#kick \" + _selectedName);" 5 serverCommand !="_character = if (serverCommandAvailable \"#kick\") then { call sched_tg_follow } else { player };" !"serverCommand (\"#kick \" + _selectedName);"
5 setDamage !"([4654,9595,0] nearestObject 145259) setDamage 1;\n([4654,9595,0] nearestObject 145260) setDamage 1;" !"if (_entity isKindOf \"Animal\") then {\n_entity setDamage 1;" !"_tree setDamage 1;\ndayz_choppedTrees set [count dayz_choppedTrees,_tree];" !="if ((alive player) && (r_fracture_legs or {player isKindOf 'PZombie_VB'})) then { player SetDamage 1;};" !"_id = [player,20,true,getPosATL player] call player_alertZombies;\nuiSleep 0.5;\nplayer setDamage 1;" !"\n_obj setDamage (damage _obj) + _damage;\n" !"if(\"\" == typeOf _tree) then {\n_tree setDamage 1;\n};" !"if (_ent isKindOf \"Animal\" || _ent isKindOf \"zZombie_base\") then {\n_ent setDamage 1;" 5 setDamage !"([4654,9595,0] nearestObject 145259) setDamage 1;\n([4654,9595,0] nearestObject 145260) setDamage 1;" !"if (_entity isKindOf \"Animal\") then {\n_entity setDamage 1;" !"_tree setDamage 1;\ndayz_choppedTrees set [count dayz_choppedTrees,_tree];" !="if ((alive player) && (r_fracture_legs or {player isKindOf 'PZombie_VB'})) then { player SetDamage 1;};" !"if (deathHandled) exitWith {};\ndeathHandled = true;\nplayer setDamage 1;" !"\n_obj setDamage (damage _obj) + _damage;\n" !"if(\"\" == typeOf _tree) then {\n_tree setDamage 1;\n};" !"if (_ent isKindOf \"Animal\" || _ent isKindOf \"zZombie_base\") then {\n_ent setDamage 1;"
5 setDammage 5 setDammage
5 SetEventHandler !="_menu ctrlSetEventHandler [\"ButtonClick\",_compile];" !="inGameUISetEventHandler [\"PrevAction\",\"false\"];" !="inGameUISetEventHandler [\"NextAction\",\"false\"];" !="inGameUISetEventHandler [\"Action\",\"false\"];" 5 SetEventHandler !="_menu ctrlSetEventHandler [\"ButtonClick\",_compile];" !="inGameUISetEventHandler [\"PrevAction\",\"false\"];" !="inGameUISetEventHandler [\"NextAction\",\"false\"];" !="inGameUISetEventHandler [\"Action\",\"false\"];"
5 setMarkerAlpha 5 setMarkerAlpha