vehicle godmode trigger?

dayzwar

Well-Known Member
Since a long time I try this without sucess. Anyone knows how to add a zone where the vehicles take no damage? Just the vehicles.
 
Code:
//Mod by Zane
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
while {true} do
  {
    waitUntil {vehicle player in list _Basis};
titleText ["Welcome to the Trading post, God mode ON.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
player allowDamage false;
    waitUntil {! (vehicle player in list _Basis)};
titleText ["Leaving Trading Post, God mode OFF.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player allowDamage true;
  }

then check your dayz code for something like
Code:
    vehicle_handleDamage    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
    vehicle_handleKilled    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";

and use the above 'safezone' to add those handlers in so vehicle_handleDamage = {}; etc etc
 
Code:
//Mod by Zane
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
while {true} do
  {
    waitUntil {vehicle player in list _Basis};
titleText ["Welcome to the Trading post, God mode ON.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
player allowDamage false;
    waitUntil {! (vehicle player in list _Basis)};
titleText ["Leaving Trading Post, God mode OFF.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
player allowDamage true;
  }

then check your dayz code for something like
Code:
    vehicle_handleDamage    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
    vehicle_handleKilled    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";

and use the above 'safezone' to add those handlers in so vehicle_handleDamage = {}; etc etc



but, that made the player godmode... no?
 
If you make the addition/change that I mentioned, it should also make vehicles have godmode.


oh, ok, so like this:


Code:
//Mod by Zane
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
while {true} do
  {
    waitUntil {vehicle player in list _Basis};
titleText ["Welcome to the Trading post, God mode ON.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
vehicle_handleDamage ={};
vehicle_handleKilled ={};
player allowDamage false;
    waitUntil {! (vehicle player in list _Basis)};
titleText ["Leaving Trading Post, God mode OFF.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
vehicle_handleDamage    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
 vehicle_handleKilled    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
player allowDamage true;
  }
 
oh, ok, so like this:


Code:
//Mod by Zane
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
while {true} do
  {
    waitUntil {vehicle player in list _Basis};
titleText ["Welcome to the Trading post, God mode ON.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
vehicle_handleDamage ={};
vehicle_handleKilled ={};
player allowDamage false;
    waitUntil {! (vehicle player in list _Basis)};
titleText ["Leaving Trading Post, God mode OFF.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
vehicle_handleDamage    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
vehicle_handleKilled    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
player allowDamage true;
  }

Yeah, should do the trick.
 
it works thanks, but ONLY if the player is there and enter the vehicle 1 time, if he go away, the vehicles will take damage.
Is not there a way to make the zone a permanent vehicle godmode no metter if there a player or not?

Code:
//Mod by Zane
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
while {true} do
  {
    waitUntil {vehicle player in list _Basis};
titleText ["Welcome to the Trading post, God mode ON.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
fnc_veh_handleDam ={};
fnc_veh_handleKilled ={};
player allowDamage false;
    waitUntil {! (vehicle player in list _Basis)};
titleText ["Leaving Trading Post, God mode OFF.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf";
fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleKilled.sqf";
player allowDamage true;
  };
 
it works thanks, but ONLY if the player is there and enter the vehicle 1 time, if he go away, the vehicles will take damage.
Is not there a way to make the zone a permanent vehicle godmode no metter if there a player or not?

Code:
//Mod by Zane
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
while {true} do
  {
    waitUntil {vehicle player in list _Basis};
titleText ["Welcome to the Trading post, God mode ON.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious  = {};
fnc_veh_handleDam ={};
fnc_veh_handleKilled ={};
player allowDamage false;
    waitUntil {! (vehicle player in list _Basis)};
titleText ["Leaving Trading Post, God mode OFF.", "PLAIN DOWN", 3];
sleep 2;
player setUnitRecoilCoefficient 1;
player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";
fnc_veh_handleDam = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleDam.sqf";
fnc_veh_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\veh_handleKilled.sqf";
player allowDamage true;
  };

Maybe if you use a vehicle activecondition in you sensor, and ten did a waitUntil {vehicletypeblah in list _Basis}
 
Code:
 expActiv="if (typeOf _x in ["Land"]) then {[Basis_West] execVM ""safezone.sqf""};"; //only modify Basis_West

That's part of your sensor. Idk if that'll work, as i've never used anything like it before, then you would do waitUntil {(typeOf _x in ["Land"]) in list _Basis} or something like that
 
Back
Top