Indestructible Vehicles near PlotPole

GeKko103

New Member
Hey guys, i am looking for help.
I have got something like a Script ;-) but it does not work for me. I put it on the bottom of the dayzcode.pbo/init/compiles.sqf:

Code:
if (isNil "fnc_vehicle_handleDamage") then {fnc_vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";};
vehicle_handleDamage = {
    private["_obj","_result","_state"];
    _obj = _this select 0;
    if ((count(nearestObjects [_obj, ["Plastic_Pole_EP1_DZ"],30]) > 0) && (locked _obj && (count (crew _obj)) == 0) && (count (magazines _obj)) == 0) && (count (weapons _obj)) == 0)) exitWith {_obj allowDamage false;};
    _state = false;
    {if ((_obj distance (_x select 0)) < 100) then {_state = true;};} forEach safezones;
    if (_state) exitWith {_obj allowDamage false;};
    _obj allowDamage true;
    _result = _this call fnc_vehicle_handleDamage;
    _result
};

I have got several problems. First of all it works on Server Restart. After this locked vehicles near the PlotPole are indestructible, but if i unlock it and take place in the drivers seat it will become destrcutible even if i lock it again. Furthermore it stays indestructible after server restart in spite of there is gear in it.
I hope anybody got a solution for that. Please guys i am despaired!
 
The Problem is, your script runs once after a server restart, but what you need is a script that runs all the time, or everytime a vehicle enters an area near a plotpole.

!what you need is a safezone-script!

Maybe you have to add a trigger at every plotpole, that react if a vehicle enters that area, and replaced the damage handler for that vehicle, also if the vehicle leaves that area.
https://community.bistudio.com/wiki/createTrigger

You can run a script with serverrestart, that searches for all plotpoles on the server and creates a trigger at this position.
 
http://epochmod.com/forum/index.php?/topic/8155-script-locked-vehicles-no-damage/page-3#entry81031



Code:
if(isNil "fnc_vehicle_handleDamage")then{fnc_vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";};
vehicle_handleDamage ={
   private["_obj","_result"];
   _obj = _this select0;
   if((count(nearestObjects [_obj,["Plastic_Pole_EP1_DZ"],90])>0)&&(locked _obj &&(count (crew _obj))==0)) exitWith {_obj allowDamage false;};
   _obj allowDamage true;
   _result = _this call fnc_vehicle_handleDamage;
   _result
};
[\code]
 
Last edited:
Back
Top