Paul 104 Report post Posted October 6, 2015 Hi Guys,Is there a way to make vehicles/doors automatically lock on restart?I know it should be down to the players to lock their stuff, but we're a PVE server, so people shouldn't be base raiding anyway. Paul 1 Share this post Link to post Share on other sites
CassiusMaximus 10 Report post Posted October 10, 2015 I would like to know the answer to this one as well Share this post Link to post Share on other sites
canuckbrian 63 Report post Posted October 11, 2015 Isn't everything locked after restart anyways? Share this post Link to post Share on other sites
Apoc 102 Report post Posted October 11, 2015 (edited) @canuckbrian, no, the server saves the state of your locks and persists that through restarts.@Paul, you need to change three files:1) ExileServer_object_construction_database_load -- This is for doors //_constructionObject setVariable ["ExileIsLocked",(_data select 14),true]; _constructionObject setVariable ["ExileIsLocked",-1,true]; //Modification to lock items on server restart - Apoc2) ExileServer_object_container_database_load --This is for safes //_containerObject setVariable ["ExileIsLocked",(_data select 3),true]; _containerObject setVariable ["ExileIsLocked",-1,true]; //Modification to lock on server restart - Apoc3) ExileServer_object_vehicle_database_load --This is for vehicle doors//if(_lock isEqualTo -1)then if(TRUE)then //Modification to lock all vehicles on server restart - ApocBoom, and you're done. Edited October 11, 2015 by Apoc clarity in comment 1 Share this post Link to post Share on other sites
Paul 104 Report post Posted October 11, 2015 Isn't everything locked after restart anyways? No, if you leave it unlocked when the server restarts, it unlocked after@canuckbrian, no, the server saves the state of your locks and persists that through restarts.@Paul, you need to change three files:1) ExileServer_object_construction_database_load -- This is for doors //_constructionObject setVariable ["ExileIsLocked",(_data select 14),true]; _constructionObject setVariable ["ExileIsLocked",-1,true]; //Modification to lock items on server restart - Apoc2) ExileServer_object_container_database_load --This is for safes //_containerObject setVariable ["ExileIsLocked",(_data select 3),true]; _containerObject setVariable ["ExileIsLocked",-1,true]; //Modification to lock on server restart - Apoc3) ExileServer_object_vehicle_database_load --This is for vehicle doors//if(_lock isEqualTo -1)then if(TRUE)then //Modification to lock all vehicles on server restart - ApocBoom, and you're done.Thanks, i'll see if i can give these a go Share this post Link to post Share on other sites
netcrew 0 Report post Posted February 14, 2016 Hi, i cant find the line //if(_lock isEqualTo -1)then if(TRUE)then //Modification to lock all vehicles on server restart - Apoc Spoiler /** * ExileServer_object_vehicle_database_load * * Exile Mod * exile.majormittens.co.uk * © 2015 Exile Mod Team * * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ private["_vehicleID","_data","_position","_vectorDirection","_vectorUp","_pinCode","_vehicleObject","_lock","_unlockInSafeZonesAfterRestart","_isLocked","_hitpoints","_cargoContainers"]; _vehicleID = _this; _data = format ["loadVehicle:%1", _vehicleID] call ExileServer_system_database_query_selectSingle; _position = [_data select 8, _data select 9, _data select 10]; _vectorDirection = [_data select 11, _data select 12, _data select 13]; _vectorUp = [_data select 14, _data select 15, _data select 16]; _pinCode = _data select 20; _vehicleObject = [(_data select 1), _position, [_vectorDirection, _vectorUp], true,_pinCode] call ExileServer_object_vehicle_createPersistentVehicle; _vehicleObject setVariable ["ExileDatabaseID", _vehicleID]; _vehicleObject setVariable ["ExileOwnerUID", (_data select 3)]; _lock = (_data select 4); _unlockInSafeZonesAfterRestart = (getNumber (configFile >> "CfgSettings" >> "VehicleSpawn" >> "unlockInSafeZonesAfterRestart")) isEqualTo 1; _isLocked = (_lock isEqualTo -1); if (_isLocked) then { if (_unlockInSafeZonesAfterRestart) then { if (_position call ExileClient_util_world_isInTraderZone) then { _isLocked = false; }; }; }; if (_isLocked) then { _vehicleObject setVariable ["ExileIsLocked", -1]; //_vehicleObject lock 2; _vehicleObject lock 0; _vehicleObject enableRopeAttach false; } else { _vehicleObject setVariable ["ExileIsLocked", 0]; _vehicleObject lock 0; _vehicleObject enableRopeAttach true; }; _vehicleObject setFuel (_data select 5); _vehicleObject setDamage (_data select 6); _hitpoints = _data select 7; if ((typeName _hitpoints) isEqualTo "ARRAY") then { { _vehicleObject setHitPointDamage [_x select 0, _x select 1]; } forEach _hitpoints; }; [_vehicleObject, (_data select 17)] call ExileServer_util_fill_fillItems; [_vehicleObject, (_data select 18)] call ExileServer_util_fill_fillMagazines; [_vehicleObject, (_data select 19)] call ExileServer_util_fill_fillWeapons; _cargoContainers = format ["loadVehicleContainer:%1", _vehicleID] call ExileServer_system_database_query_selectSingle; if ((typeName _cargoContainers) isEqualTo "ARRAY") then { if !(_cargoContainers isEqualTo []) then { [_vehicleObject, (_cargoContainers select 0)] call ExileServer_util_fill_fillContainers; }; }; _vehicleObject enableSimulationGlobal false; _vehicleObject call ExileServer_system_simulationMonitor_addVehicle; if (_vehicleObject call ExileClient_util_world_isInTraderZone) then { _vehicleObject allowDamage false; }; _vehicleObject Share this post Link to post Share on other sites
ranathane 0 Report post Posted July 31, 2017 (edited) Here is 1.0.3 location for last one (I think). Line 49 Seems to work ok. Spoiler _isLocked = true; //(_lock isEqualTo -1); <-----HERE if (_isLocked) then { if (_unlockInSafeZonesAfterRestart) then { if (_position call ExileClient_util_world_isInTraderZone) then { _isLocked = false; }; }; }; if (_isLocked) then { _vehicleObject setVariable ["ExileIsLocked", -1]; _vehicleObject lock 2; _vehicleObject enableRopeAttach false; } else { _vehicleObject setVariable ["ExileIsLocked", 0]; _vehicleObject lock 0; _vehicleObject enableRopeAttach true; }; Edited August 2, 2017 by ranathane missed a semicolon Share this post Link to post Share on other sites
(SAD) Sickpuppy 0 Report post Posted June 2 Where do I find the 3 files? Share this post Link to post Share on other sites
Thomas1973 2 Report post Posted June 2 4 hours ago, (SAD) Sickpuppy said: Where do I find the 3 files? @ExileServer\addons\exile_server\code Share this post Link to post Share on other sites