diff --git a/SQF/dayz_code/compile/player_lockVault.sqf b/SQF/dayz_code/compile/player_lockVault.sqf index 1aa880a96..7b5f680d4 100644 --- a/SQF/dayz_code/compile/player_lockVault.sqf +++ b/SQF/dayz_code/compile/player_lockVault.sqf @@ -43,9 +43,8 @@ _pos = _obj getVariable["OEMPos",(getposATL _obj)]; if(!isNull _obj) then { - //force vault save just before locking - PVDZE_veh_Update = [_obj,"gear"]; - publicVariableServer "PVDZE_veh_Update"; + PVDZE_log_lockUnlock = [player, _obj,true]; + publicVariableServer "PVDZE_log_lockUnlock"; //place vault _holder = createVehicle [_lockedClass,_pos,[], 0, "CAN_COLLIDE"]; diff --git a/SQF/dayz_code/compile/player_unlockVault.sqf b/SQF/dayz_code/compile/player_unlockVault.sqf index 529f41c02..e705dc6d4 100644 --- a/SQF/dayz_code/compile/player_unlockVault.sqf +++ b/SQF/dayz_code/compile/player_unlockVault.sqf @@ -58,6 +58,9 @@ if ((_ownerID == dayz_combination) or (_ownerID == dayz_playerUID)) then { if(!isNull _obj and alive _obj) then { + PVDZE_log_lockUnlock = [player, _obj, false]; + publicVariableServer "PVDZE_log_lockUnlock"; + _obj setVariable["packing",1]; [1,1] call dayz_HungerThirst; _weapons = _obj getVariable["WeaponCargo",[]]; diff --git a/SQF/dayz_code/init/publicEH.sqf b/SQF/dayz_code/init/publicEH.sqf index 79ece7442..3d51ac242 100644 --- a/SQF/dayz_code/init/publicEH.sqf +++ b/SQF/dayz_code/init/publicEH.sqf @@ -70,8 +70,7 @@ if (isServer) then { "PVDZE_plr_TradeMenu" addPublicVariableEventHandler {(_this select 1) spawn server_traders}; "PVDZE_plr_DeathB" addPublicVariableEventHandler {(_this select 1) spawn server_deaths}; - "PVDZE_obj_getlocalVars" addPublicVariableEventHandler {(_this select 1) spawn server_getLocalObjVars}; - "PVDZE_obj_setlocalVars" addPublicVariableEventHandler {(_this select 1) spawn server_setLocalObjVars}; + "PVDZE_log_lockUnlock" addPublicVariableEventHandler {(_this select 1) spawn server_logUnlockLockEvent}; }; //Client only diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index de34bfa19..911a40d58 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -882,3 +882,20 @@ server_spawnCleanAnimals = { diag_log (format["CLEANUP: Deleted %1 Animals out of %2",_delQtyAnimal,_qty]); }; }; + +server_logUnlockLockEvent = { + private["_player", "_obj", "_objectID", "_objectUID", "_statusText", "_status"]; + _player = _this select 0; + _obj = _this select 1; + _status = _this select 2; + if (!isNull(_obj)) then { + _objectID = _obj getVariable["ObjectID", "0"]; + _objectUID = _obj getVariable["ObjectUID", "0"]; + _statusText = "UNLOCKED" + if (_status) then { + [_obj, "gear"] call server_updateObject; + _statusText = "LOCKED" + }; + diag_log format["SAFE %5: ID:%1 UID:%2 BY %3(%4)", _objectID, _objectUID, (name _player), (getPlayerUID _player), _statusText]; + }; +}; \ No newline at end of file