Jump to content
Zupa

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

Recommended Posts

Version 2.0 released.

 

Problems shoul been fixed

Great job, you got ma beans :)

There is only one thing left, vehicles near plots are still damageable after a restart untill you unlock it and then lock it again. Maybe need to run it serverside?

 

Thanks

Share this post


Link to post
Share on other sites

Can someone test this for me? i wont be on anarma pc in 7 hours.

 

So the normal shizzle +

 

compiles:

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

to

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

then make "fn_damageHandlerVehicle.sqf" iin a folder "custom":  !!!!!!!!!!!!!!!! Change the config to the same as your other damage handler !!!!!!!!!!! Will make this universal later

scriptName "Functions\misc\fn_damageHandler.sqf";
/***********************************************************
	PROCESS DAMAGE TO A UNIT
	- Function
	- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
************************************************************/
private ["_unit","_hit","_damage","_total"];
_unit = _this select 0;
_hit = _this select 1;
_damage = _this select 2;
//_source = _this select 3;
//_ammo = _this select 4;
_total = _damage;
_state = true;

//***Zupa Config ****//

_godmodeVechilesEverywhere = false; // Godmode on all locked vehicles
_onlyLockedVehicles = true; //Plotarea: Godmode for Only locked vehicles (true) or locked and unlocked(false)
_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 ****//


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

systemChat "locked or all";
};

if(_state)then{
if(_safeZoneGodVehicle )then{
{if ((_unit distance (_x select 0)) < 120) then {_state = false;
systemChat "safezone";
};} forEach _safezones;
};
};


if(_state)then{
_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 ((locked _unit || !(_onlyLockedVehicles) ) && (count (crew _unit)) < 1 && (  !(_donatorsPlots) || (_plotOwner in _plotDonators))) then {_state = false;
systemChat "plot";
};
};
};



//diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));

if (local _unit && _state) then {
	_total = [_unit,_hit,_damage] call object_setHitServer;
};
_total

Share this post


Link to post
Share on other sites

 

Can someone test this for me? i wont be on anarma pc in 7 hours.

 

So the normal shizzle +

 

compiles:

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

to

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

then make "fn_damageHandlerVehicle.sqf" iin a folder "custom":  !!!!!!!!!!!!!!!! Change the config to the same as your other damage handler !!!!!!!!!!! Will make this universal later

scriptName "Functions\misc\fn_damageHandler.sqf";
/***********************************************************
	PROCESS DAMAGE TO A UNIT
	- Function
	- [unit, selectionName, damage, source, projectile] call fnc_usec_damageHandler;
************************************************************/
private ["_unit","_hit","_damage","_total"];
_unit = _this select 0;
_hit = _this select 1;
_damage = _this select 2;
//_source = _this select 3;
//_ammo = _this select 4;
_total = _damage;
_state = true;

//***Zupa Config ****//

_godmodeVechilesEverywhere = false; // Godmode on all locked vehicles
_onlyLockedVehicles = true; //Plotarea: Godmode for Only locked vehicles (true) or locked and unlocked(false)
_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 ****//


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

systemChat "locked or all";
};

if(_state)then{
if(_safeZoneGodVehicle )then{
{if ((_unit distance (_x select 0)) < 120) then {_state = false;
systemChat "safezone";
};} forEach _safezones;
};
};


if(_state)then{
_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 ((locked _unit || !(_onlyLockedVehicles) ) && (count (crew _unit)) < 1 && (  !(_donatorsPlots) || (_plotOwner in _plotDonators))) then {_state = false;
systemChat "plot";
};
};
};



//diag_log ("DAMAGE VEH: " + typeof(_unit) + " / " + str(_hit) + " / " + str(_damage) + " / " + str(getDammage _unit));

if (local _unit && _state) then {
	_total = [_unit,_hit,_damage] call object_setHitServer;
};
_total

Tested that, no change.

Share this post


Link to post
Share on other sites

Tested that, no change.

 

Try the following, it will be like a dafuq, didnt i think of that earlier solution=

 

take the 2 compile lines =

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

and place them on the bottom of the compiles, right above the 

initialized = true;

Share this post


Link to post
Share on other sites

Edited: Disregard. I didn't see the configs in each file. Set them both the same and seems to be working fine so far. Will continue testing.... thanks!

 

------original post below---------------

 

You're getting there.... After restart, locked vehicle in plot zone takes no damage. Unlocked and drove vehicle outside plotzone and locked it... still takes no damage. Unlocked it... takes damage. Drove back into plotzone and locked it... takes no damage. Unlocked it... takes damage.

 

So it's still indestructible after leaving the plotzone and locked again. Locked vehicles outside the plotzone after server restart take damage as intended.

Share this post


Link to post
Share on other sites

Put this in tonight.  Seems to be working really well.  I'm so bummed I spent about 4 hours trying to get a plot pole for life working as I love the idea of intergrating the two, however in the end I just couldn't get it working.  Something to do with snap building vectors and PPFL, but I couldn't get my head around it.

 

Thanks for this script Zupa.  It will def stop alot of griefing.

Share this post


Link to post
Share on other sites

With new script i have to add the new and not replace this old lines?

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

So all 4 lines are in compiles.sqf ?

 

Add or replace? ^^

 

If i dont replace it will use the day_code files and custom files simultaneously? oO I'm confused :D

Share this post


Link to post
Share on other sites

I tested this with Heli's and it seems to be working fine?

Hmm... not sure what I've done wrong then lol. The only changes I made to the files were for the coords (Tavi vs. Cherno) but while running a car into a car works fine (no damage to either vehicle), for some reason running a car into a heli causes damage to the heli only. I'll try re-installing, see if that helps.

Thanks :)

Share this post


Link to post
Share on other sites

Edit// Okay seems like I got it working actually. Files didn't have same config settings. But the safe-zone area detection is still slightly off.

If anyone wants vehicle god-mode to be activated in the actual area not just 120 meters around given coordinates then do this:

 

Find:

{if ((_unit distance (_x select 0)) < 120) then {_state = false;

Replace it with:

{if ((_unit distance (_x select 0)) < (_x select 1)) then {_state = false;

And do this for both files.

 

 

So now when you look at your array:

[[6315.88,7791.3],100,"Stary"]

The "100" there is the radius of the safe zone and that's the area where vehicle godmode is now active.

 

 

Edit// Zupa has now edited the first post, no need to do this anymore ^

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By thegdog
      2:08:04 Error Type Any, expected String 2:08:04 File z\addons\dayz_server\compile\server_playerSync.sqf, line 41 2:08:12 Server: Object 3:54 not found (message 70) 2:08:12 "Server_PublishVehicle2 error: Wrong parameter format" 2:08:12 "Trader Menu: jeffdog (76561198147272349) purchased 1x BAF_Merlin_DZE into gear at Aircraft Trader for 1 ItemObsidian" 2:08:12 Error in expression <ceFoot = 0; trying to buy aircraft from the default aircraft trader.  never touched any of it and it giving this error.  no vehicle spawns.  it shows the arrow.  EDIT:  i tried other traders, all vehicles dont spawn when bought.
    • By LadyVal
      As I said before, I am new in all these.  We rented a GTX server with everything on and we are trying to set some costumization but.... yes, there is always a but... I would like to ask some help.
      Please, consider me as a total new in scripting and I need a "step by step for dummies"
      1.- I am trying to set the entire server into PVE so no player could harm other player or kamikaze into anybody.  How and where do you handle this "godmode" so I turn the server into PVE?
      2.- Though like I said we want the server to be PVE, the idea is to make 2 exceptions and create 2 pvp areas (in Cherno and Elektro).  How you Mark those areas in map with notifications 100 mts (for example) "you are entering a pvp area"
      3.- Admintools: I set them exactly like the step by step guide but it is giving an error (I dont have antihack), 
      4.- Since the problem with Bohemia and BE, I could never make the messages announcing the server restart again, any idea would be welcome.
      And... that's it for now.   I know it is a lot and very "dummy questions" but, what can I say, I am kinda dummy in this topic
      Thanks for any help
    • By webbie
      Hi all, Ive been looking for a while now for a vehicle flip script for a single player.
      Ive tried stuff ive used on previous servers but its not allowing the option so im guessing epoch has something that interferes with it.
      If anyone knows of a simple script to allow players to do this could you link it to me please,
      Thanks in advance.
      PS. Im aware the jacks flip vehicles but I actually  find this to be incredibly painstaking unless theirs a trick to it.
    • By Honey Bee
      Hallo zusammen,
      Die glorreiche Idee den Fahrzeugen das Volumen zu nehmen war jetzt nicht gerade der Bringer. Alle beschweren. Jetzt hab ich mal geschaut aber finde nix wo die Kapazität der Fahrzeuge drin steht. Jemand Erfahrung damit?
       
      Hi,
      how can i change the Vehicle capacity?
       
      THX
    • By nova
      This is a new version of a safezone script and an a.i/a.i vehicle remover. To be used in conjunction with the 1061 safezone script. So say your safe zone is being bombarded with roaming a.i and you are tired of going to safe zones to delete them this will do it automatically when you go within 350 meters of an roaming a.i while in a safezone. The distance is customizable. The new safezone script allows you to receive god mode for 20 secs after you leave the safe zone IF you have stayed in the safezone long enough. This will avoid players from touching the safe zone and taking off for a way to avoid combat from other players. All credits go to @juandayz for this. Uploaded with his permission. 
       
      1- into mpmission\your instance\scripts\  create a new folder called "safezone"
      2-into this folder create this sqf:
      safezone_ai_remover.sqf
       
      3-open your init.sqf
       
      4-Now if ure using DZAI:
       
      5-If ure using DZMS then do the same:
       
      6-If you are using some kind of other script that spawns enemy ai vehicles then add the same variable.. for example:
       
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...