diff --git a/SQF/dayz_code/compile/player_humanityMorph.sqf b/SQF/dayz_code/compile/player_humanityMorph.sqf index 18fb21543..1bfd831ec 100644 --- a/SQF/dayz_code/compile/player_humanityMorph.sqf +++ b/SQF/dayz_code/compile/player_humanityMorph.sqf @@ -4,7 +4,7 @@ _charID = _this select 1; _model = _this select 2; _old = player; -player allowDamage false; +_old allowDamage false; player removeEventHandler ["FiredNear",eh_player_killed]; player removeEventHandler ["HandleDamage",mydamage_eh1]; player removeEventHandler ["Killed",mydamage_eh3]; @@ -38,7 +38,7 @@ if (Z_SingleCurrency) then { }; //Switch -_model call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done +[_model, _charID] call player_switchModel; //Already spawned thread, no need to spawn and waitUntil script is done //Login @@ -111,10 +111,7 @@ dayz_actionInProgress = false; //Allow self actions to run now. eh_player_killed = player addeventhandler ["FiredNear",{_this call player_weaponFiredNear;}]; [player] call fnc_usec_damageHandle; player allowDamage true; - -player addWeapon "Loot"; -uiSleep 0.1; -call dayz_meleeMagazineCheck; +call player_forceSave; uiSleep 0.1; if !(isNull _old) then {deleteVehicle _old;}; \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_onPause.sqf b/SQF/dayz_code/compile/player_onPause.sqf index 97038448d..628bdb8f7 100644 --- a/SQF/dayz_code/compile/player_onPause.sqf +++ b/SQF/dayz_code/compile/player_onPause.sqf @@ -1,4 +1,4 @@ -private ["_display","_timeout","_inCombat","_playerCheck","_zedCheck"]; +private ["_display","_timeout","_inCombat","_playerCheck","_zedCheck","_lastPing"]; disableSerialization; waitUntil { _display = findDisplay 49; @@ -11,6 +11,9 @@ _btnAbort ctrlEnable false; _btnAbortText = ctrlText _btnAbort; _isPZombie = player isKindOf "PZombie_VB"; _testTime = diag_tickTime; +PVDZE_PingSend = player; +publicVariableServer "PVDZE_PingSend"; +_lastPing = diag_tickTime; if (r_fracture_legs or _isPZombie) then {_btnRespawn ctrlEnable true;}; @@ -29,7 +32,20 @@ while {(!isNull _display) && !r_player_dead} do { if (!isNull _gearDisplay) then { _gearDisplay closeDisplay 0; }; + if (diag_tickTime - _lastPing > 2) then { + PVDZE_PingSend = player; + publicVariableServer "PVDZE_PingSend"; + _lastPing = diag_tickTime; + }; switch true do { + case (diag_tickTime - DZE_LastPingResp > 4) : { + _btnAbort ctrlEnable false; + _btnAbort ctrlSetText format["%1 (in 10)", _btnAbortText]; + if (TimeOutDisplayed) then { + _display closeDisplay 2; + closeDialog 2; + }; + }; case (_playerCheck) : { _btnAbort ctrlEnable false; _btnAbort ctrlSetText format["%1 (in 10)", _btnAbortText];