willidshome
Well-Known Member
I must first say I have copied this code from others in the forum and adapted it to suit my needs so a big thank you to all those who have posted code for people like me to use.
What I am after is making vehicles immune to any damage whilst in a safezone, the code I have is listed below and I have searched the forum for bits which I have installed and adapted but still no joy.
mission.sqm (in sensors)
admin.sqf (Safezone info, if PUID is listed allow if not run other scripts)
godmode.sqf (activates player god mode)
Any help would be grateful and a big thanks to all those whose code I have copied and used.
What I am after is making vehicles immune to any damage whilst in a safezone, the code I have is listed below and I have searched the forum for bits which I have installed and adapted but still no joy.
mission.sqm (in sensors)
Code:
class Item10 //ADMIN BASE CHERNO
{
position[]={GRID LOCATION};
a=30;
b=30;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="AdminBase";
expCond="(vehicle player) in thislist;";
expActiv="adminbase = [] execVM ""custom_scripts\player_zones\admin.sqf"";";
expDesactiv="terminate adminbase; titleText [""LEFT ADMIN BASE GOD MODE OFF !!"", ""PLAIN DOWN"", 3]; execVM ""custom_scripts\player_zones\godmode.sqf"";";
class Effects
{
titleType="TEXT";
titleEffect="PLAIN DOWN";
title="You are entering a restricted zone.";
};
};
admin.sqf (Safezone info, if PUID is listed allow if not run other scripts)
Code:
if ((getPlayerUID player) in ["PUID","PUID"]) then {
titleText ["ENTERED ADMIN BASE. GOD MODE ON !!", "PLAIN DOWN", 3];
sleep 5;
///////START HERE////////
////PLAYER GOD MODE
player setUnitRecoilCoefficient 0;
player_zombieCheck = {};
fnc_usec_damageHandler = {};
fnc_usec_unconscious = {};
player allowDamage false;
///VEHICLE GOD MODE
//// END HERE //////
} else {
sleep 5 ;
titleText ["This area is protected by Deadly Nerve Gas, LEAVE NOW...", "PLAIN DOWN", 3];
sleep 15;
titleText ["I hope your immune to Nerve Gas...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 45 seconds before Nerve Gas takes effect..", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have lost the use of your hands and lost your weapons !!", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 15 seconds before Nerve Gas totally effects you..", "PLAIN DOWN", 3];
sleep 15;
titleText ["You were warned..! We will bury you in a Shallow Grave", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};
godmode.sqf (activates player god mode)
Code:
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed"];
_Basis = _this select 0; //Basisname
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;
Any help would be grateful and a big thanks to all those whose code I have copied and used.