Jump to content
Zupa

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

Recommended Posts

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

 

 

In your compiles.sqf ABOVE:

initialized = true;

place

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

and make a file in "zupa" folder called "vehicle_handleDamage.sqf" with inside:

 

FIXED CODE

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;

};
};
};

}; //fix
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

AND in "zupa" folder: fn_damageHandlerVehicle.sqf

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)
_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 ****//


systemChat "checks";
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;

};
};
};



//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

Hey,

First thanks for sharing but there are some issues i have on my testserver:

-Vehicles parket in the plotarea can take damage after a restart till you unlock it, after you unlocked it it have godmode.

-If you drive in the area it doesnt matter if the car is locked/unlocked or a person is inside it always have godmode.

-The godmode stays if you are leaving the area (tested with ~700m) tested with locked/unlocked and one player inside, same result.

Share this post


Link to post
Share on other sites

Hey,

First thanks for sharing but there are some issues i have on my testserver:

-Vehicles parket in the plotarea can take damage after a restart till you unlock it, after you unlocked it it have godmode.

-If you drive in the area it doesnt matter if the car is locked/unlocked or a person is inside it always have godmode.

-The godmode stays if you are leaving the area (tested with ~700m) tested with locked/unlocked and one player inside, same result.

 

hmm strange, i did motified it witouth testing yes, so i'll test it this evening and debug it.

 

it sounds like a typo and the script crashes so there is never damage applied.

 

AND maybe, just a question,

 

You maybe have a 2nd damage handler on bottom of your compiles?

Share this post


Link to post
Share on other sites

hmm strange, i did motified it witouth testing yes, so i'll test it this evening and debug it.

 

it sounds like a typo and the script crashes so there is never damage applied.

 

AND maybe, just a question,

 

You maybe have a 2nd damage handler on bottom of your compiles?

 

Nope, no second compile for a damagehandler of any kind

Share this post


Link to post
Share on other sites

 

why this part ??

please explain its function

if a player gets into vehicle and locks it to be indestructable ?? player or car is destroyed ??

  • As soon someone is in them, DESTROY THEM

 

 

It means, u cannot abuse the system.

 

For example:

 

Get in gunner seat, your friend locks the car, The gunner can shoot but nobody can damage the vehicle. That would be OP.

 

So as soon as there is someone in the car, it doesnt have godmode

Share this post


Link to post
Share on other sites

Hey Zupa...

 

Since i've installed this script, damaged vehicles get automatic fully repaired if you click at "repair vehicle" - without use of items like windscreen, wheels and so on...

 

Ok thx for that feedback, that explains why that was happening, now i know where to fix it ^^ standby ^^

Share this post


Link to post
Share on other sites

I have got several Problems with that script. First of all it works on Server restart. After this locked vehicles near the PlotPole are indestructible, but if i unlock them and take place in the drivers seat it will become destructible even if i lock it again!

Any ideas how to solve it?
In addition i would like to have the function that vehicles which got gear in it stay destructible, sth like this:
 

&& ((count (magazines _obj)) == 0) && ((count (weapons _obj)) == 0)

Does anybody knows how to add it, so it will work because i do not want those vehciles as vault replacement!

Thanks for any answer :-*

Share this post


Link to post
Share on other sites

not sure if i did some thing wrong,  im sure i did it ok, But when i buy a car from vendor god mod stays on after i leave, and also when i leave my plot pole area,   i have driven a hell of a long way and its still on.

 

Many thanks 

 

keith

Share this post


Link to post
Share on other sites

issue: Put this up on the server last night and EVERY vehicle on the map, locked and unlocked has godmode. Other than that, nice work man.

I have the same issue, vehicle that are already on the map have godmode, but if I spawn an unlocked one in using infistar that vehicle doesn't have god mode.

Share this post


Link to post
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

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

×