From 0f93e592ec239bb68a4e02e80f1b79b25294a574 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Mon, 25 Nov 2013 09:36:55 -0600 Subject: [PATCH] cleanup vault lock --- SQF/dayz_code/compile/player_lockVault.sqf | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/SQF/dayz_code/compile/player_lockVault.sqf b/SQF/dayz_code/compile/player_lockVault.sqf index e439b2c79..fe0fb05b0 100644 --- a/SQF/dayz_code/compile/player_lockVault.sqf +++ b/SQF/dayz_code/compile/player_lockVault.sqf @@ -8,38 +8,38 @@ private ["_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_holder","_we if(TradeInprogress) exitWith { cutText [(localize "str_epoch_player_10") , "PLAIN DOWN"]; }; TradeInprogress = true; -_obj = _this; +player removeAction s_player_lockvault; +s_player_lockvault = 1; -_lockedClass = getText (configFile >> "CfgVehicles" >> (typeOf _obj) >> "lockedClass"); -_text = getText (configFile >> "CfgVehicles" >> (typeOf _obj) >> "displayName"); +_obj = _this; +_objType = typeOf _obj; + +_lockedClass = getText (configFile >> "CfgVehicles" >> _objType >> "lockedClass"); +_text = getText (configFile >> "CfgVehicles" >> _objType >> "displayName"); // Silently exit if object no longer exists if(isNull _obj) exitWith { TradeInprogress = false; }; +player playActionNow "Medic"; +sleep 1; +[player,"tentpack",0,false] call dayz_zombieSpeak; +sleep 5; + _playerNear = _obj call dze_isnearest_player; if(_playerNear) exitWith { TradeInprogress = false; cutText [(localize "str_epoch_player_11") , "PLAIN DOWN"]; }; _ownerID = _obj getVariable["CharacterID","0"]; _objectID = _obj getVariable["ObjectID","0"]; _objectUID = _obj getVariable["ObjectUID","0"]; -player playActionNow "Medic"; - -player removeAction s_player_lockvault; -s_player_lockvault = 1; if((_ownerID != dayz_combination) and (_ownerID != dayz_playerUID)) exitWith {TradeInprogress = false; s_player_lockvault = -1; cutText [format[(localize "str_epoch_player_115"),_text], "PLAIN DOWN"]; }; _alreadyPacking = _obj getVariable["packing",0]; - if (_alreadyPacking == 1) exitWith {TradeInprogress = false; s_player_lockvault = -1; cutText [format[(localize "str_epoch_player_116"),_text], "PLAIN DOWN"]}; - _obj setVariable["packing",1]; _dir = direction _obj; -// _pos = getposATL _obj; -_pos = _obj getVariable["OEMPos",(getposATL _obj)]; -[player,"tentpack",0,false] call dayz_zombieSpeak; -sleep 3; +_pos = _obj getVariable["OEMPos",(getposATL _obj)]; if(!isNull _obj) then { @@ -77,7 +77,6 @@ if(!isNull _obj) then { }; cutText [format[(localize "str_epoch_player_117"),_text], "PLAIN DOWN"]; - - s_player_lockvault = -1; }; +s_player_lockvault = -1; TradeInprogress = false; \ No newline at end of file