From 7a19c7abefbfffbe10ca1aaaf608af304d3cc7ea Mon Sep 17 00:00:00 2001 From: oiad Date: Sun, 14 Jun 2020 12:45:42 +1200 Subject: [PATCH] Rearrange packVault Thanks @AirwavesMan for the headsup. --- SQF/dayz_code/compile/player_packVault.sqf | 43 ++++++++++------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/SQF/dayz_code/compile/player_packVault.sqf b/SQF/dayz_code/compile/player_packVault.sqf index 920e843b1..f75fade97 100644 --- a/SQF/dayz_code/compile/player_packVault.sqf +++ b/SQF/dayz_code/compile/player_packVault.sqf @@ -5,14 +5,14 @@ dayz_actionInProgress = true; [_obj] spawn player_packVault; */ -private ["_obj","_ownerID","_objectID","_objectUID","_location1","_location2","_packedClass","_text","_playerNear","_finished","_ComboMatch","_typeOf"]; +private ["_obj","_ownerID","_objectID","_objectUID","_packedClass","_text","_playerNear","_finished","_ComboMatch","_typeOf"]; _obj = _this; _typeOf = typeOf _obj; _packedClass = getText (configFile >> "CfgVehicles" >> _typeOf >> "packedClass"); _text = getText (configFile >> "CfgVehicles" >> _typeOf >> "displayName"); -if (isNull _obj || !(alive _obj)) exitWith { dayz_actionInProgress = false; }; +if (isNull _obj || !(alive _obj)) exitWith {dayz_actionInProgress = false;}; _playerNear = {isPlayer _x} count (([_obj] call FNC_GetPos) nearEntities ["CAManBase", 12]) > 1; if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;}; @@ -31,37 +31,32 @@ if (_objectID == "0" && _objectUID == "0") exitWith {dayz_actionInProgress = fal if (!_ComboMatch && (_ownerID != dayz_playerUID)) exitWith {dayz_actionInProgress = false; s_player_packvault = -1; format[localize "str_epoch_player_119",_text] call dayz_rollingMessages;}; format[localize "str_epoch_player_121",_text] call dayz_rollingMessages; -uiSleep 1; -_location1 = getPosATL player; -uiSleep 5; -_location2 = getPosATL player; -if (_location1 distance _location2 > 0.1) exitWith { - format[localize "str_epoch_player_122",_text] call dayz_rollingMessages; - s_player_packvault = -1; - dayz_actionInProgress = false; -}; +if (!isNull _obj && {alive _obj}) exitWith {s_player_packvault = -1;dayz_actionInProgress = false;}; +[player,"tentpack",0,false] call dayz_zombieSpeak; -if (!isNull _obj && {alive _obj}) then { - [player,"tentpack",0,false] call dayz_zombieSpeak; +format[localize "str_epoch_player_121",_text] call dayz_rollingMessages; - _finished = ["Medic",1] call fn_loopAction; - if (isNull _obj || !_finished) exitWith {}; +_finished = ["Medic",1] call fn_loopAction; +if (isNull _obj || !_finished) exitWith {s_player_packvault = -1;dayz_actionInProgress = false;}; - ["Working",0,[3,2,4,0]] call dayz_NutritionSystem; +(findDisplay 106) closeDisplay 0; // Close gear - (findDisplay 106) closeDisplay 0; // Close gear - dze_waiting = nil; +_playerNear = {isPlayer _x} count (([_obj] call FNC_GetPos) nearEntities ["CAManBase", 12]) > 1; +if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;}; - [_packedClass,objNull] call fn_waitForObject; +["Working",0,[3,2,4,0]] call dayz_NutritionSystem; - PVDZE_handleSafeGear = [player,_obj,2]; - publicVariableServer "PVDZE_handleSafeGear"; +dze_waiting = nil; - waitUntil {!isNil "dze_waiting"}; // wait for response from server to verify pack was logged and gear added before proceeding +[_packedClass,objNull] call fn_waitForObject; - format[localize "str_epoch_player_123",_text] call dayz_rollingMessages; -}; +PVDZE_handleSafeGear = [player,_obj,2]; +publicVariableServer "PVDZE_handleSafeGear"; + +waitUntil {!isNil "dze_waiting"}; // wait for response from server to verify pack was logged and gear added before proceeding + +format[localize "str_epoch_player_123",_text] call dayz_rollingMessages; s_player_packvault = -1; dayz_actionInProgress = false;