Jump to content

[RELEASE] Vehicle Godmode in Plotpoles & Safezones & Everywhere Locked 2.0


Zupa

Recommended Posts

Hi

Sorry for my bad English

 

I create the two sqf in the Folder zupa

then i putt this in my compiles.sqf

fnc_usec_damageVehicle = compile preprocessFileLineNumbers "zupa\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
vehicle_handleDamage = compile preprocessFileLineNumbers "zupa\vehicle_handleDamage.sqf";

initialized = true;

i write this to my server and make restart the server dont start

i search for the problem and found this

//fnc_usec_damageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
fnc_usec_damageVehicle = compile preprocessFileLineNumbers "zupa\fn_damageHandlerVehicle.sqf"; //Event handler run on damage


// object_vehicleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_vehicleKilled.sqf"; //Event handler run on damage
object_setHitServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHitServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
object_setFixServer = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setFixServer.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
object_getHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_getHit.sqf"; //gets the hit value for a HitPoint (i.e. HitLegs) against the selection (i.e. "legs"), returns the value
object_setHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_setHit.sqf"; //process the hit as a NORMAL damage (useful for persistent vehicles)
object_processHit = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_processHit.sqf"; //process the hit in the REVO damage system (records && sets hit)
object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
// object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player || server to monitor changes in cargo contents
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
// Vehicle damage fix
//vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
vehicle_handleDamage = compile preprocessFileLineNumbers "zupa\vehicle_handleDamage.sqf";


i do this ..... restart the server godmode at plotpole are in funktion but every vehicle on the map are in godmode

 

i dont find the error please help me

mfg nuss

Link to comment
Share on other sites

Hi Sorry i must wait for server restart

 

I do the 2 files

fnc_usec_damageVehicle = compile preprocessFileLineNumbers "zupa\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
vehicle_handleDamage = compile preprocessFileLineNumbers "zupa\vehicle_handleDamage.sqf";

initialized = true;

 

in my compiles.sqf     the server restart ??? yes  he restart  !!!  :)

 

but any vehicles are in godmode

 

 

here my rpt

 

mfg nuss

 

 

arma2oaserver.zip

Link to comment
Share on other sites

Did my custom compiles fine,

removed the two old paths and put in the two new ones

 

However every time I start the game I get stuck on the load screen, I can hear my player run around but the loadscreen stays.

In my RPT it says

"Cannot find file Overrides\fn_damageHandlerVehicle.sqf"

"Cannot find file Overrides\vehicle_handleDamage"

 

Im sitting here looking at the two files in my overrides folder with no clue as to why they are not being found.,

Link to comment
Share on other sites

Hi Sorry i must wait for server restart

 

I do the 2 files

fnc_usec_damageVehicle = compile preprocessFileLineNumbers "zupa\fn_damageHandlerVehicle.sqf"; //Event handler run on damage

vehicle_handleDamage = compile preprocessFileLineNumbers "zupa\vehicle_handleDamage.sqf";

initialized = true;

 

in my compiles.sqf     the server restart ??? yes  he restart  !!!  :)

 

but any vehicles are in godmode

 

 

here my rpt

 

mfg nuss

 

Seems you have some errors in your server_function.sqf at line 248 and line 257

 

This could be of a non included AllVechicles or somekind of that stuff.

 

I'll need tot test this this evening again.

 

put the gear config to false and test again

Link to comment
Share on other sites

Did my custom compiles fine,

removed the two old paths and put in the two new ones

 

However every time I start the game I get stuck on the load screen, I can hear my player run around but the loadscreen stays.

In my RPT it says

"Cannot find file Overrides\fn_damageHandlerVehicle.sqf"

"Cannot find file Overrides\vehicle_handleDamage"

 

Im sitting here looking at the two files in my overrides folder with no clue as to why they are not being found.,

 

Check if the capitals are correct.

 

Your second handler has no .sqf behind it

Link to comment
Share on other sites

 

Vehicle Godmode in Plotpoles & Safezones & Everywhere Locked 2.0 Fixed

 

This scripts adds a configurable file where u can set the following options:

  • Vechicles godmode in safezones
  • Vechiles godmode in plotpole areas
    • Locked or all vehicles godmoded 
  • ​Only donaters godmode vehicles in plotpole areas.
  • As soon someone is in them, DESTROY THEM
  • Added later: Locked Vechicles all over the map.

 

  • Added later: Option to allow damage on vehicles with gear in them even when locked at plotpoles

 

Is there way to change plot pole to another obect to make safe zones for vehicles? Like fireplace or firebarrel and change 30m to 50m?

 

b_560_95_1.png

Link to comment
Share on other sites

Hey dude

 

I’m stuck on a little issue again, i know the issue isn’t directly related to this mod but someone with damage handler knowledge would be rather handy :)

When the server restarts all Hive sided vehicles are now god mode, they take no damage what so ever. If you spawn an object through admin OP it is not god until the following restart.

But if you spawn a item via the admin menu as Hive or from trader it is indestructible instantly.

The mod’s i run that use damage handlers are the following.

 

  • indestructible cinder/metal items
  • god mode traders
  • this mod

Unfortunately, nobody realised this issue for some time so it’s pretty much impossible to find out where it originated from.

 

Any ideas ?

 

Cheers

Link to comment
Share on other sites

Hey dude

 

I’m stuck on a little issue again, i know the issue isn’t directly related to this mod but someone with damage handler knowledge would be rather handy :)

When the server restarts all Hive sided vehicles are now god mode, they take no damage what so ever. If you spawn an object through admin OP it is not god until the following restart.

But if you spawn a item via the admin menu as Hive or from trader it is indestructible instantly.

The mod’s i run that use damage handlers are the following.

 

  • indestructible cinder/metal items
  • god mode traders
  • this mod

Unfortunately, nobody realised this issue for some time so it’s pretty much impossible to find out where it originated from.

 

Any ideas ?

 

Cheers

Im not sure but in my compiles.sqf was 2 times called files 

fnc_usec_damageVehicle =        compile preprocessFileLineNumbers "zupa\fn_damageHandlerVehicle.sqf";      
vehicle_handleDamage =          compile preprocessFileLineNumbers "zupa\vehicle_handleDamage.sqf";

So i comment original two lines and works fine.

 

b_560_95_1.png

Link to comment
Share on other sites

Im not sure but in my compiles.sqf was 2 times called files 

fnc_usec_damageVehicle =        compile preprocessFileLineNumbers "zupa\fn_damageHandlerVehicle.sqf";      
vehicle_handleDamage =          compile preprocessFileLineNumbers "zupa\vehicle_handleDamage.sqf";

So i comment original two lines and works fine.

 

You got any rpt errors?

 

And do you use the version with the gear checks or the one before that?

 

Als so check the client RPT files for errors ( prob a bunch of them in there).

 

+ Why do u always link your server in your post..... 

 

We are all devs here, we are not joining your server cus you post it in every post you make ( and it's not your signature, so u type it everytime) xD

Link to comment
Share on other sites

You got any rpt errors?

 

And do you use the version with the gear checks or the one before that?

 

Als so check the client RPT files for errors ( prob a bunch of them in there).

I can cant see any issues server side, neither client side that relate to damage handlers.

I am using the gear checks version but have set it to false.

I tried both replacing the calls in compiles and removing them and just using the new ones at the bottom. But to no avail.

 

Cheers

Link to comment
Share on other sites

I can cant see any issues server side, neither client side that relate to damage handlers.

I am using the gear checks version but have set it to false.

I tried both replacing the calls in compiles and removing them and just using the new ones at the bottom. But to no avail.

 

Cheers

 

i think your problem is in server_monitor

 

You probably disable damahandler on the objects.

Link to comment
Share on other sites

You got any rpt errors?

 

And do you use the version with the gear checks or the one before that?

 

Als so check the client RPT files for errors ( prob a bunch of them in there).

 

+ Why do u always link your server in your post..... 

 

We are all devs here, we are not joining your server cus you post it in every post you make ( and it's not your signature, so u type it everytime) xD

I dont have any errors on my RPT,  and i link my server cose i can same as a lot of people here, so what

Link to comment
Share on other sites

Found the issue dude, checked over my monitor and found no issues.

Found that the newest script with the gear checks was causing the issues.

Even if was set true/false it made all hive spawned Items God while non hive not god :huh: .

 

I dug out a old version and remove the gear checks out and bobs your uncle the issue was resolved.

Also found, not sure if it was done on purpose but if you have _donatorsPlots set to false. All plot poles are God.

Once i set that to true with luckly my PUID :p only my plot was god :)

 

Interesting shiz B)

Link to comment
Share on other sites

private["_selection","_state","_strH","_total","_unit"];
//***Zupa Config ****//
_godmodeVechilesEverywhere = false; // Godmode on all locked vehicles
_onlyLockedVehicles = true; //Plotarea: Godmode for Only locked vehicles (true) or locked and unlocked(false)
_onlyVehicleWithoutGear = true; // Only godmode on vehicles that hold no gear.
_safeZoneGodVehicle = true; // Godmode vehicles in safezones. (or specific zone's)
// donator plotpole only works with PLOT FOR LIFE, set FALSE if you dont have it.
_donatorsPlots = false; // True = only godmode vehicles for donaters in the list, False = godmode for every guy.
_plotDonators = ["76561198101253426","505"]; // PUID's of poeple who donated for plotpole
// Chernarus safezone area's - change these to other coordinates for other maps. ( You can also add specific locations on the map.
_safezones = [ 
    [[5070.75,9729.54],100,"Air"],
    [[1606.6443,7803.5156],100,"Bandit"],
    [[4063.4226,11664.19],100,"Bash"],
    [[12944.227,12766.889],100,"Hero"],
    [[11447.472,11364.504],100,"Klen"],
    [[6315.88,7791.3],100,"Stary"] // [[x,y],distance,"just name"]
];
//***END Config ****//

_unit = _this select 0;
_selection = _this select 1;
_total = _this select 2;
_state = true;
_HPBefore = -1;

if (_selection != "") then {
	_strH = "hit_" + _selection;
	_HPBefore = [_unit,_strH] call object_getHit; 
} else {
	_strH = "totalDmg";
	_HPBefore = getDammage _unit;
};

if (_total > _HPBefore) then {

	if ((locked _unit && _godmodeVechilesEverywhere  && (count (crew _unit)) < 1))then{_state = false;};

	if (_state) then {
		if (_safeZoneGodVehicle ) then {
			{
				if ((_unit distance (_x select 0)) < (_x select 1)) then {_state = false;};
			} forEach _safezones;
		};
	};
	
	if (_state) then {
		_gearCount = 0;
		
		if (_onlyVehicleWithoutGear) then {
			//_weaps = count(getWeaponCargo _unit);
			//_mags = count(getMagazineCargo _unit);
			//_backs = count(getBackpackCargo _unit);
			//_gearCount = _gearCount + _weaps + _mags + _backs;
		};
		
		_plots = nearestObjects [_unit, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];	
		
		if ((count(_plots) > 0)) then {
			_thePlot = _plots select 0;
			_plotOwner = _thePlot getVariable ["ownerPUID",0];
			if ((_gearCount == 0) &&(locked _unit || !(_onlyLockedVehicles)) && (count (crew _unit)) < 1 && (!(_donatorsPlots) || (_plotOwner in _plotDonators))) then {_state = false;};
		};
	};
	
	if (_state) then {
		if (_total >= 0.98) then {_total = 1.0;};
	
		if (local _unit) then {
			if (_total > 0) then {
				_unit setVariable [_strH, _total, true];
				_unit setHit [_selection, _total];
				if (isServer) then {
					[_unit, "damage"] call server_updateObject;
				} else {
					PVDZE_veh_Update = [_unit,"damage"];
					publicVariableServer "PVDZE_veh_Update";
				};
			};
		} else {
			// vehicle is not local to this client, ask the client which vehicle is local to set damage
			/* PVS/PVC - Skaronator */
			PVDZE_send = [_unit,"VehHandleDam",_this];
			publicVariableServer "PVDZE_send";
		};
	} else {
		_total = _HPBefore;
	};
// all "HandleDamage event" functions should return the effective damage that the engine will record for that part
_total

 

I am curious if that is intentional or not but I was looking at your code and was formatting it and I saw that

if (_total > _HPBefore) then {

this if loop has no closing part };

thats kinda weirdm shouldnt this create some errors down the road?

Link to comment
Share on other sites

private["_selection","_state","_strH","_total","_unit"];
//***Zupa Config ****//
_godmodeVechilesEverywhere = false; // Godmode on all locked vehicles
_onlyLockedVehicles = true; //Plotarea: Godmode for Only locked vehicles (true) or locked and unlocked(false)
_onlyVehicleWithoutGear = true; // Only godmode on vehicles that hold no gear.
_safeZoneGodVehicle = true; // Godmode vehicles in safezones. (or specific zone's)
// donator plotpole only works with PLOT FOR LIFE, set FALSE if you dont have it.
_donatorsPlots = false; // True = only godmode vehicles for donaters in the list, False = godmode for every guy.
_plotDonators = ["76561198101253426","505"]; // PUID's of poeple who donated for plotpole
// Chernarus safezone area's - change these to other coordinates for other maps. ( You can also add specific locations on the map.
_safezones = [ 
    [[5070.75,9729.54],100,"Air"],
    [[1606.6443,7803.5156],100,"Bandit"],
    [[4063.4226,11664.19],100,"Bash"],
    [[12944.227,12766.889],100,"Hero"],
    [[11447.472,11364.504],100,"Klen"],
    [[6315.88,7791.3],100,"Stary"] // [[x,y],distance,"just name"]
];
//***END Config ****//

_unit = _this select 0;
_selection = _this select 1;
_total = _this select 2;
_state = true;
_HPBefore = -1;

if (_selection != "") then {
	_strH = "hit_" + _selection;
	_HPBefore = [_unit,_strH] call object_getHit; 
} else {
	_strH = "totalDmg";
	_HPBefore = getDammage _unit;
};

if (_total > _HPBefore) then {

	if ((locked _unit && _godmodeVechilesEverywhere  && (count (crew _unit)) < 1))then{_state = false;};

	if (_state) then {
		if (_safeZoneGodVehicle ) then {
			{
				if ((_unit distance (_x select 0)) < (_x select 1)) then {_state = false;};
			} forEach _safezones;
		};
	};
	
	if (_state) then {
		_gearCount = 0;
		
		if (_onlyVehicleWithoutGear) then {
			//_weaps = count(getWeaponCargo _unit);
			//_mags = count(getMagazineCargo _unit);
			//_backs = count(getBackpackCargo _unit);
			//_gearCount = _gearCount + _weaps + _mags + _backs;
		};
		
		_plots = nearestObjects [_unit, ["Plastic_Pole_EP1_DZ"], DZE_PlotPole select 0];	
		
		if ((count(_plots) > 0)) then {
			_thePlot = _plots select 0;
			_plotOwner = _thePlot getVariable ["ownerPUID",0];
			if ((_gearCount == 0) &&(locked _unit || !(_onlyLockedVehicles)) && (count (crew _unit)) < 1 && (!(_donatorsPlots) || (_plotOwner in _plotDonators))) then {_state = false;};
		};
	};
	
	if (_state) then {
		if (_total >= 0.98) then {_total = 1.0;};
	
		if (local _unit) then {
			if (_total > 0) then {
				_unit setVariable [_strH, _total, true];
				_unit setHit [_selection, _total];
				if (isServer) then {
					[_unit, "damage"] call server_updateObject;
				} else {
					PVDZE_veh_Update = [_unit,"damage"];
					publicVariableServer "PVDZE_veh_Update";
				};
			};
		} else {
			// vehicle is not local to this client, ask the client which vehicle is local to set damage
			/* PVS/PVC - Skaronator */
			PVDZE_send = [_unit,"VehHandleDam",_this];
			publicVariableServer "PVDZE_send";
		};
	} else {
		_total = _HPBefore;
	};
// all "HandleDamage event" functions should return the effective damage that the engine will record for that part
_total

 

I am curious if that is intentional or not but I was looking at your code and was formatting it and I saw that

if (_total > _HPBefore) then {

this if loop has no closing part };

thats kinda weirdm shouldnt this create some errors down the road?

 

You are right, there is a }; missing, 

 

place a

};

above

if(_state)then{


if (_total >= 0.98) then {
        _total = 1.0;
};

why this doesnt give an error is because the the script gets executed and it RETURNS _total before it even gets to the closing bracket. So the scripts get executed successfully.

 

you probably find some errors in your client rpt saying that stuff afterwards.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...