mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-17 09:10:27 +03:00
Update dayz_onback again
This commit is contained in:
@@ -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