mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Update dayz_onback again
This commit is contained in:
@@ -59,7 +59,7 @@ if (_characterID != "?") then {
|
||||
//if player object is alive lets sync the player and remove the body and if ghosting is active add the player id to the array
|
||||
if (alive _playerObj) then {
|
||||
// High priority. Sync must finish fast before player object isNull
|
||||
[_playerObj,nil,"",[],_inCombat] call server_playerSync;
|
||||
[_playerObj,nil,nil,nil,_inCombat] call server_playerSync;
|
||||
|
||||
/*
|
||||
Low priority code below this point where
|
||||
@@ -71,7 +71,7 @@ if (_characterID != "?") then {
|
||||
// Moved setVariables to server_playerSync since they are high priority
|
||||
// Messages are low priority. Player object not needed
|
||||
diag_log format["PLAYER COMBAT LOGGED: %1(%3) at location %2",_playerName,_playerPos,_playerUID];
|
||||
[nil, nil, rTitleText, format["PLAYER COMBAT LOGGED: %1",_playerName], "PLAIN"] call RE; // Message whole server
|
||||
[nil, nil, rTitleText, format["Player %1 combat logged at location %2.",_playerName, mapGridPosition _playerPos], "PLAIN"] call RE; // Message whole server
|
||||
};
|
||||
|
||||
if (dayz_enableGhosting) then {
|
||||
|
||||
@@ -239,7 +239,7 @@ _playerObj setVariable ["lastTime",diag_ticktime];
|
||||
|
||||
//set server-side inventory variable to monitor player gear
|
||||
if (count _inventory > 2) then {
|
||||
_playerObj setVariable["ServerMagArray",[_inventory select 1,_inventory select 2], false];
|
||||
_playerObj setVariable["ServerMagArray",[_inventory select 1,_inventory select 2,_inventory select 0], false];
|
||||
};
|
||||
|
||||
//Record Player Login/LogOut
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
local _character = _this select 0;
|
||||
local _magazines = _this select 1;
|
||||
local _dayz_onBack = _this select 2;
|
||||
local _weapons = _this select 3;
|
||||
local _weaponsPlayer = _this select 3;
|
||||
local _characterID = _character getVariable ["characterID","0"];
|
||||
local _playerUID = getPlayerUID _character;
|
||||
local _charPos = getPosATL _character;
|
||||
@@ -41,7 +41,7 @@ local _usec_Dead = _character getVariable ["USEC_isDead",false];
|
||||
local _lastTime = _character getVariable ["lastTime",-1];
|
||||
local _modelChk = _character getVariable ["model_CHK",""];
|
||||
local _temp = round (_character getVariable ["temperature",100]);
|
||||
local _lastMagazines = _character getVariable ["ServerMagArray",[[],""]];
|
||||
local _lastMagazines = _character getVariable ["ServerMagArray",[[],"",[]]];
|
||||
//Get difference between current stats and stats at last sync
|
||||
local _statsDiff = [_character,_playerUID] call server_getStatsDiff;
|
||||
_humanity = _statsDiff select 0;
|
||||
@@ -54,11 +54,17 @@ local _charPosLen = count _charPos;
|
||||
local _magTemp = [];
|
||||
|
||||
if (!isNil "_magazines") then {
|
||||
_playerGear = [_weapons,_magazines,_dayz_onBack];
|
||||
_character setVariable["ServerMagArray",[_magazines,_dayz_onBack], false];
|
||||
_playerGear = [_weaponsPlayer,_magazines,_dayz_onBack];
|
||||
_character setVariable["ServerMagArray",[_magazines,_dayz_onBack,_weaponsPlayer], false];
|
||||
} else {
|
||||
//check Magazines everytime they aren't sent by player_forceSave
|
||||
_magTemp = (_lastMagazines select 0);
|
||||
if (isNil "_dayz_onBack") then {
|
||||
_dayz_onBack = _lastMagazines select 1;
|
||||
};
|
||||
if (isNil "_weaponsPlayer") then {
|
||||
_weaponsPlayer = _lastMagazines select 2;
|
||||
};
|
||||
if (count _magTemp > 0) then {
|
||||
_magazines = [(magazines _character),20] call array_reduceSize;
|
||||
{
|
||||
@@ -77,10 +83,14 @@ if (!isNil "_magazines") then {
|
||||
};
|
||||
} forEach (_lastMagazines select 0);
|
||||
_magazines = _magTemp - ["0"];
|
||||
_magazines = [_magazines, (_lastMagazines select 1)];
|
||||
_magazines = [_magazines,_dayz_onBack,_weaponsPlayer];
|
||||
_character setVariable["ServerMagArray",_magazines, false];
|
||||
_playerGear = [_weapons,_magazines select 0,_magazines select 1];
|
||||
_playerGear = [_magazines select 2,_magazines select 0,_magazines select 1];
|
||||
} else {
|
||||
_magazines = [_magTemp,_dayz_onBack,_weaponsPlayer];
|
||||
};
|
||||
_character setVariable["ServerMagArray",_magazines, false];
|
||||
_playerGear = [_magazines select 2,_magazines select 0,_magazines select 1];
|
||||
};
|
||||
|
||||
//Check if update is requested
|
||||
|
||||
Reference in New Issue
Block a user