Jump to content

[Tutorial] Disabling R3F Tow/Lift for Locked Vehicles


MrTesla

Recommended Posts

This will disable the functions of the R3F Artillery & Logistics addon (tow, lift, load in, and move) for vehicles that are locked.

 

Requirements:

-Something to unpack pbo files, such as PBO Manager.

-Text editor (Notepad++ recommended)

 

1. Unpack these files:

-dayz_code.pbo from your @DayZ_Epoch folder in your Arma 2 OA directory

-mission pbo

-server pbo (dayz_server.pbo)

 

2. Copy the "local_lockunlock.sqf" from "dayz_code\compile\" folder and the "compiles.sqf" from the "dayz_code\init\" folder and place them into your mission file. For this tutorial, they'll be placed in a folder call "Custom".

NOTE: If you already have a custom "compiles.sqf" in your mission file (such as for self BB and other addons) you don't need to copy it over. Just use the one you already have and skip step 5.

 

3. In the "local_lockunlock.sqf", change this section (and only this section):

if (local _vehicle) then {
	if(_status) then {
		_vehicle setVehicleLock "LOCKED";
	} else {
		_vehicle setVehicleLock "UNLOCKED";
	};
};

to this:

if (local _vehicle) then {
	if(_status) then {
		_vehicle setVehicleLock "LOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",true,true];
	} else {
		_vehicle setVehicleLock "UNLOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",false,true];
	};
};

4. In "compiles.sqf", change the file path in this line to point to your edited "local_lockunlock.sqf":

local_lockUnlock =			compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lockUnlock.sqf";		//When vehicle is local to unit perform locking vehicle

So for this tutorial, it would be changed to this:

local_lockUnlock =			compile preprocessFileLineNumbers "Custom\local_lockUnlock.sqf";		//When vehicle is local to unit perform locking vehicle

5. In your mission file's "init.sqf", change the file path in this line to point to your edited "compiles.sqf":

call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";				//Compile regular functions

For this tutorial, it would be changed to this:

call compile preprocessFileLineNumbers "Custom\compiles.sqf";				//Compile regular functions

6. Repack the mission file and upload it to your server.

 

7. Open "server_publishVehicle2.sqf" in the "dayz_server\compile\" folder and "server_monitor.sqf" in the "dayz_server\system\" folder.

 

8. In "server_publishVehicle2.sqf", after the 3rd line (_object setvehiclelock "locked";):

    if(!_donotusekey) then {
        // Lock vehicle
        _object setvehiclelock "locked";
    };

add this line:

_object setVariable ["R3F_LOG_disabled",true,true];

9. Do the same thing in the "server_monitor.sqf" in this section:

if(_ownerID != "0" and !(_object isKindOf "Bicycle")) then {
	_object setvehiclelock "locked";
};

so it should look like this:

if(_ownerID != "0" and !(_object isKindOf "Bicycle")) then {
	_object setvehiclelock "locked";
        _object setVariable ["R3F_LOG_disabled",true,true];
};

10. Repack the server pbo and upload it to the server.

Link to comment
Share on other sites

Works like a charm, you just made our bases far more secure by not allowing anyone to lift our vehicles out and away :)

 

This is exactly why I added this, as people were able to airlift vehicles through roofs and tow through walls, which was very silly and defeated the purpose of base building in the first place.

Link to comment
Share on other sites


9. Do the same thing in the "server_monitor.sqf" in this section:

if(_ownerID != "0") then {
	_object setvehiclelock "locked";
};

10. Repack the server pbo and upload it to the server.

 

For that last step , do I put "_object setVariable ["R3F_LOG_disabled",true,true];" before or after the }; ?

 

I only ask because up until that point all your steps involved replacing the entire block, or putting the new code at the very end of the block.  Thought this may also clear it up for anyone having issues with the code not working.. 

So to recap, is it:

if(_ownerID != "0") then {
	_object setvehiclelock "locked";
_object setVariable ["R3F_LOG_disabled",true,true];
};

Or is it:

if(_ownerID != "0") then {
	_object setvehiclelock "locked";
};
_object setVariable ["R3F_LOG_disabled",true,true];

Thanks :)

Link to comment
Share on other sites

if(_ownerID != "0") then {
    _object setvehiclelock "locked";
    _object setVariable ["R3F_LOG_disabled",true,true];
};

you should already deal with a bit of C++ before trying to it  :P

 

 

I'm a php developer, so I understand enough to make this work. I was just clarifying for others on here who have posted with issues.  I've just finished getting AI missions working with the Epoch Event system, not bad for a arma coding noob :p

Link to comment
Share on other sites

I install it but when i want unlock a car i press on UNLOCK but nothing happen i just can press UNLOCK all times! i do Copy/Paste for not make fault but.... maybe the Copy/paste is my fault?! i have check the lines of command but i don't know or see the "ERROR"! Can you help me!

 

(Sorry for the grammar fault i am french and i no speak english all times)

Link to comment
Share on other sites

I have done everything as instructed but when I load the server it just loads into a bunch of hills with invisible people, seems to do this any time I edit dayz_server.pbo (HFBServers) could it be some thing to do with my host or am I doing some thing wrong?

 

server_monitor.sqf (dayz_server.pbo)

if(_ownerID != "0") then {
	_object setvehiclelock "locked";
	_object setVariable ["R3F_LOG_disabled",true,true];
};

server_publishvehicle2.sqf

	// Lock vehicle
	_object setvehiclelock "locked";
	
	_object setVariable ["R3F_LOG_disabled",true,true];

	clearWeaponCargoGlobal  _object;
	clearMagazineCargoGlobal  _object;

init.sqf

//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "Custom\compiles.sqf";
progressLoadingScreen 0.5;
call compile preprocessFileLineNumbers "server_traders.sqf";
progressLoadingScreen 1.0;

 

local_lockunlock.sqf

private ["_vehicle","_status"];
_vehicle = _this select 0;
_status = _this select 1;

if (local _vehicle) then {
	if(_status) then {
		_vehicle setVehicleLock "LOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",true,true];
	} else {
		_vehicle setVehicleLock "UNLOCKED";
		_vehicle setVariable ["R3F_LOG_disabled",false,true];
	};
};

compiles.sqf

local_lockUnlock =			compile preprocessFileLineNumbers "Custom\local_lockUnlock.sqf";

Anything look wrong there?

Link to comment
Share on other sites

Did you put the compiles.sqf and locallockunlock.sqf in a folder called "Custom"? Other than that nothing seems to be wrong.

 

Yeah there in the Custom folder but still doesn't work, starting to think its HFB, even editting the server_code.pbo the smallest bit it loads up with invisible characters.

Link to comment
Share on other sites

same for me Fishie798 :(

Did you solve the problem?

 

edit:

because i didn't test the r3f log addon, I just set the code back to original and got the same "error". deinstalling the r3flog addon from the root solved it.

So it seems to be the r3f addon causing the trouble.

Link to comment
Share on other sites

same for me Fishie798 :(

Did you solve the problem?

 

edit:

because i didn't test the r3f log addon, I just set the code back to original and got the same "error". deinstalling the r3flog addon from the root solved it.

So it seems to be the r3f addon causing the trouble.

Hey I had the same issue. For me it was how i extracted and repacked the dayz_server.pbo, specifically the server_monitor.sqf. If you are using PBO Manager 1.4 Beta, try going to your server_monitor.sqf file and right click it in PBO Manager and cut it, paste it to desktop then edit it Notepad ++ and save it then cut it from the desk top and paste it back in the same location in the PBO Manager. ( dayz_server.pbo/system/server_monitor.sqf) Close PBO Manager and upload the dayz_server.pbo back to the server.

Link to comment
Share on other sites

  • 3 weeks later...

I install it but when i want unlock a car i press on UNLOCK but nothing happen i just can press UNLOCK all times! i do Copy/Paste for not make fault but.... maybe the Copy/paste is my fault?! i have check the lines of command but i don't know or see the "ERROR"! Can you help me!

 

(Sorry for the grammar fault i am french and i no speak english all times)

 

I must say I have the same problem, haven't found a fix yet / J' ai aussi cet probleme, si j'ai trouvé une solution je vais vous dire

 

EDIT: In case someone experiences the same problem: I overwrote the whole local_lockUnlock file with the new code and that way I deleted:

 

private ["_vehicle","_status"];

_vehicle = _this select 0;

_status = _this select 1;

 

Which made it so that I could not unlock cars anymore. :) So make sure you didn't delete that

Link to comment
Share on other sites

Is anyone else having problems getting this to work on a Vilayer server? I followed the instructions to the letter. Even got someone else to check it to make sure i done it correctly. 

 

The lift and tow works perfectly as well as the ability to un/lock vehicles. However i can still lift/tow locked vehicles. 

Link to comment
Share on other sites

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
  • Advertisement
×
×
  • Create New...