Jump to content

Question

7 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • By Donnovan
      *** UPDATED WITH A MAJOR BUG FIX IN THE DATE 2014-10-06 1:10 PM
      *** This update will fix the Repair Vehicle working always in all cases
      *** without the need of vehicle parts, wheell, glass, motor or tools

      *** The only file that changed was the file lock_god.sqf.

      Hi,

      Here is My Locked Vehicles with God Mode.

      FEATURES:

      - The Vehicles survives Kamikaze attack!
      - The God Mode not expires when the player exit the server!
      - Can be easily upgraded to plot proximity god mode or anything else!
      - Initial locked Vehicles have God Mode!

      INSTALLATION!

      1) LOCK_GOD.SQF
      Create a file with the name lock_god.sqf, with the content bellow, and put it into a folder called custom inside your mission folder.

      if (isServer) then { "cad_pvar_set_veh" addPublicVariableEventHandler { private ["_veh","_godOn"]; _veh = _this select 1 select 0; _godOn = _this select 1 select 1; if (_godOn) then { _veh allowDamage false; _veh RemoveAllEventHandlers "handleDamage"; _veh addEventHandler ["handleDamage",{0}]; } else { _veh allowDamage true; _veh RemoveAllEventHandlers "handleDamage"; _veh addEventHandler ["handleDamage",{_this call vehicle_handleDamage;}]; }; }; }; local_lockUnlock = { private ["_vehicle","_status"]; _vehicle = _this select 0; _status = _this select 1; if (local _vehicle || isServer) then { if(_status) then { _vehicle setVehicleLock "LOCKED"; if (count (crew _vehicle) == 0) then{ //MIKE POST _vehicle allowDamage false; _vehicle RemoveAllEventHandlers "handleDamage"; _vehicle addEventHandler ["handleDamage",{0}]; cad_pvar_set_veh = [_vehicle,true]; publicVariableServer "cad_pvar_set_veh"; }; //MIKE POST } else { _vehicle setVehicleLock "UNLOCKED"; _vehicle allowDamage true; _vehicle RemoveAllEventHandlers "handleDamage"; _vehicle addEventHandler ["handleDamage",{_this call vehicle_handleDamage;}]; cad_pvar_set_veh = [_vehicle,false]; publicVariableServer "cad_pvar_set_veh"; }; }; }; 2)INIT.SQFOpen your init.sqf (located in your mission folder) and search for that line:

      call compile preprocessFileLineNumbers "z\addons\dayz_code\init\compiles.sqf"; //Compile regular functionsIf you don't find it, search for the line:
      call compile preprocessFileLineNumbers "dayz_code\init\compiles.sqf"; //Compile regular functionsBellow it, add the line:
      call compile preprocessFileLineNumbers "custom\lock_god.sqf"; 3) SYSTEM/SERVER_MONITOR.SQF:Now, to make initial locked vehicles invunerable until unlocked, you must modify the server_monitor.sqf server file, located in dayz_server/system/server_monitor.sqf:
      Change that:


      if(_ownerID != "0" && !(_object isKindOf "Bicycle")) then { _object setvehiclelock "locked"; }; To that:
      if(_ownerID != "0" && !(_object isKindOf "Bicycle")) then { _object setvehiclelock "locked"; //LOCK GOD BEGIN _object allowDamage false; _object RemoveAllEventHandlers "handleDamage"; _object addEventHandler ["handleDamage",{0}]; //LOCK GOD END }; 4) BATTLEYE EXCESSION:
      You need to liberate the public variable cad_pvar_set_veh in BattlEye.

      END

      It's done!

      I have done tests with players of my server. But feel free to make your tests so we have sure everything is ok!
  • Advertisement
  • Donation Box

    Please donate to support the community.
    We appreciate all donations!
  • Advertisement
  • Supporters
  • Latest Donations

  • Advertisement
  • Discord

×