Jump to content
  • 0

[SOLVED] Variables.sqf 1.0.6.1 vs Variables.sqf 1.0.5.1


Thug

Question

[SOLVED]

in 1.0.5.1 the following is where I added a vehicle so when a player got in it, it would not blow up.  I am using the UralCivil2 as a loot box. It spawns in at start up.

DZE_safeVehicle = ["ParachuteWest","ParachuteC","UralCivil2"];

My question is can this line still be used in the variables.sqf in 1.0.6.1?

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

This is where it checks to see if the vehicle is allowed/not allowed: https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_server/system/scheduler/sched_safetyVehicle.sqf#L4

So what we can see there is we have 2 different arrays we can put allowed vehicles in.

dayz_serverObjectMonitor

is for server side objects to be allowed, you would use this like:

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_vehicle];

where _vehicle is the vehicle or crate that you have createVehicled that needs to be whitelisted, this will store the actual object.

Or you can have a global array (server/client) that is:

DZE_safeVehicle

Like what you mentioned. The problem with what you are using is then it whitelists ALL of that vehicle type, the first example (dayz_serverObjectMonitor) whitelists specific vehicles/crates so its more specific and secure.

 

TLDR:  If your script is server side, don't use DZE_safeVehicle, use dayz_serverObjectMonitor.

Link to comment
Share on other sites

  • 0
On 6/7/2017 at 3:07 PM, salival said:

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_vehicle];

would this be the right way?

sched_safetyVehicle = {
    {
        //if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && !((typeOf vehicle _x) in DZE_safeVehicle)) then {
        if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,UralCivil2] && !((typeOf vehicle _x) in DZE_safeVehicle)) then {

            diag_log [ __FILE__, "KILLING A HACKER", name _x, " IN ", typeOf vehicle _x ];
            (vehicle _x) setDamage 1;
            _x setDamage 1;
        };
    } forEach allUnits;

    objNull
};

Link to comment
Share on other sites

  • 0

@Thug

i think salival is talking about put the  line in your vehicle script the one in server side not in the sched_safety

example:

UralCivil2.sqf

Spoiler

_class = "UralCivil2";
_startingpos = "whatever place do you spawn it"
_ural =  createVehicle [_class, [(_startingpos select 0) + 50, (_startingpos select 1) + 50],[], 0, "NONE"];
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_ural];

 

 

If u wanna modify the sched_safetyVehicle to not add this line.. the best way is create a variable.

example:

ural.sqf

Spoiler

_class = "UralCivil2";
_startingpos = "whatever place do you spawn it"
_ural =  createVehicle [_class, [(_startingpos select 0) + 50, (_startingpos select 1) + 50],[], 0, "NONE"];
_ural setvariable ["vehicleAllowed",1,true];

 

sched_safety_veh

Spoiler

sched_safetyVehicle = {
	{
		if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && !((typeOf vehicle _x) in DZE_safeVehicle)) then {
		if (vehicle _x getVariable ["vehicleAllowed",0] == 1) exitWith { };
			diag_log [ __FILE__, "KILLING A HACKER", name _x, " IN ", typeOf vehicle _x ];
			(vehicle _x) setDamage 1;
			_x setDamage 1;
		};
	} forEach allUnits;

	objNull
};

 

So you can spawns anyother kind of vehicles.. and everytime you add this variable.. the veh_scheduler gonna made a bypass on vehicles where "vehicleAllowed" = 1;

 

 

but if u run the script who spawns the ural by client side.. then you only need add his Id in a custom variables.sqf

DZE_MY_VEH = ["UralCivil2",""];
DZE_safeVehicle = DZE_MY_VEH +["ParachuteWest","ParachuteC"];

 

Link to comment
Share on other sites

  • 0
1 hour ago, Thug said:

would this be the right way?

sched_safetyVehicle = {
    {
        //if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor) && !((typeOf vehicle _x) in DZE_safeVehicle)) then {
        if (vehicle _x != _x && !(vehicle _x in dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,UralCivil2] && !((typeOf vehicle _x) in DZE_safeVehicle)) then {

            diag_log [ __FILE__, "KILLING A HACKER", name _x, " IN ", typeOf vehicle _x ];
            (vehicle _x) setDamage 1;
            _x setDamage 1;
        };
    } forEach allUnits;

    objNull
};

No, completely the wrong tangent there

Here's an example from WAI vehicle patrol script

https://github.com/ebayShopper/WICKED-AI/blob/master/WAI/compile/vehicle_patrol.sqf#L60-L68

What this code does is create a vehicle, doe all the initialization stuff (set full fuel, engine on, ammo to 1 etc)

Then it does the 

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_vehicle];

To add it to the list of "do not kill for hacking".

If you link the script you are using that is causing this we can add it into that.

Link to comment
Share on other sites

  • 0
2 minutes ago, Thug said:

Here is the file that I am using UralCivil2_lotto.sqf

https://pastebin.com/6SGUxduR

After this line:

_crate = createVehicle ["UralCivil2",[(_coords select 0),(_coords select 1),0],[], 0, "CAN_COLLIDE"];

Add this line:

dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_crate];

*edit*

You will need to do this for each crate you have in that script

_crate1,_crate2,_crate3,_crate4 etc

Link to comment
Share on other sites

  • 0
6 minutes ago, Thug said:

Thank you so much and that was the fastest reply i have ever got.  you get an A+

Just need to make sure you do the same with the rest of the crates in there since there are 5 total, but obviously changing the variable name (_crate, _crate1, _crate2, _crate3, _crate 4) etc.

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
  • Discord

×
×
  • Create New...