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 Sp4rkY
      Title:                 SPK_ESVP
      Author:            Sp4rkY (Github)
      Description:   Extended Safezones with Vehicle Protection for Arma 3 Epoch
      Version:           0.9
      Required:        Arma 3 1.66+ / Epoch 0.4+
      Credits:            IT07 (Thx for many brain) (Github)
                                |V.I.P.| CH!LL3R (Thx for thoughts & testing!)

      DOWNLOAD & INSTALL INSTRUCTIONS:
      >>> >> > CLICK ME < << <<<
      Edit by EpochMod - 2019-11-08:
      There came some issues up with the Arma 1.96 update.
      Unfortunately @Sp4rkY currently seems to be not active here, so we have added a pull request for his GitHub files.
      So if you want to use this addon, check / add this changes:
      https://github.com/SPKcoding/A3_Epoch_ESVP/pull/2/files

      FEATURES:
      * Fully customizable
      * Works with all maps
      * Works for players and vehicles
      * No more `"ProtectionZone_Invisible_F"` is needed (usually found in map config in a3_epoch_server_settings.pbo)
      * Fired bullets will automatically be deleted in safezones
      * (optional) Teleport players out of safezones after restart
      * (optional) Teleport players away from the parking place (if used) after restart
      * Protection from idiots trying to drive over other players (including traders)
      * Check vehicle ownership of bought vehicles
      * (optional) Teleport vehicles out of safezones at server restart to:
          - (optional) a given distance from the respective safezone
          - (optional) a static parking place (you can use your own map addition and define as many parking lots you want)
      * (optional) Restricted vehicle´s access in safezones (only the owner(s) can enter the vehicle)
      * (optional) Restricted vehicle´s gear-access in safezones (only the owner(s) can access the vehicle´s inventory)
      * (optional) Protection for lifted vehicle´s
          - If using this feature, there will be also a check for the owner, so stealing is not possible
      * (optional) Unlock teleported vehicles
      * 2 ways of info messages (depends on if vehicle protection is used or not)
      * (optional) Vehicle Access Menu:
          - "Refresh" button to update the player-list while menu is open
          - "Registered" listing to see which players are added to your vehicle
          - "Clear" button to remove the added players
      * (optional) restrict access to driver seat for primary vehicle owner
      * slingload check for bought vehicles (you can not steal cars or ships)
      * (optional) info messages for prohibited lifting
      * (optional) Prevent spawning of antagonists (UAV, Sappers, Snakes, Cultists) in safezones
      * (optional) Allow/disallow to chop/sledge/chainsaw anything in safezones
      * (optional) Feature to set map markers directly from this script (no need to define them anywhere else)
      * If using the "vehicle teleporting WITHOUT Parking Place" - function:
          - the vehicles get teleported to a random position within the given radius out of the safezones
      * If using the "vehicle teleporting WITH Parking Place" - function, it will works like this:
          - server restarts, vehicles in safezones will be teleported to a parking place
          - vehicles which are present at the parking place are getting teleported to a random location on the map, new vehicles (in safezones) are ported to the parking place
      * If the respective safezone contains water, ships are treated like this:
          - if ships are located at water surface, they gets teleported close to the safezone´s shore at given radius
          - if ships are located at terrain surface because of lifting or simliar, they gets ported random at the maps shore
      * If not using "vehicle teleporting" - function, remaining vehicles in safezones are indestructible after restart
      * Debug option for better determine errors (client & server)
       
      Enjoy this stuff and have fun!
      cheers
    • 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.
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...