Jump to content

safe trader citys


Achmed

Recommended Posts

None of this code is my own, i have simply combined the code from http://opendayz.net/threads/safe-zone-with-god-mode-for-all-players.12237/ with the original epoch code. All credit goes to the original code developers

 

 

Make a folder called "safezones" in the root of your mission.pbo

 

create 3 files in the safezones folder called "safezone_stary.sqf", "safezone_bash.sqf" and "safezone_klen.sqf"

 

in the file called "safezone_stary.sqf" paste 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 trader city Stary, 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 trader city Stary, 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;
  } 

in the file called "safezone_bash.sqf" paste 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 trader city Bash, 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 trader city Bash, 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;
  } 

in the file called "safezone_klen.sqf" paste 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 trader city Klen, 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 trader city Klen, 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;
  } 

Open your mission.sqm file and find "class sensors". It will be at around line 1300

 

Replace everything from "class sensors" to just before "class intro" with

	class Sensors
	{
		items=3;
		class Item0
		{
			position[]={6325.6772,304.99033,7807.7412};
			a=100;
			b=100;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			text="Basis_West_Stary";
			name="Basis_West_Stary";
			expCond="(player distance Basis_West_Stary) < 100;";
			expActiv="if (playerSide == WEST) then {[Basis_West_Stary] execVM ""safezones\safezone_stary.sqf""}; canbuild = false;";
			expDesactiv="canbuild = true;";
			class Effects
			{
			};
		};
		class Item1
		{
			position[]={4063.4226,365.00577,11664.19};
			a=100;
			b=100;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			text="Basis_West_Bash";
			name="Basis_West_Bash";
			expCond="(player distance Basis_West_Bash) < 100;";
			expActiv="if (playerSide == WEST) then {[Basis_West_Bash] execVM ""safezones\safezone_bash.sqf""}; canbuild = false;";
			expDesactiv="canbuild = true;";
			class Effects
			{
			};
		};
		class Item2
		{
			position[]={11447.472,317.26886,11364.504};
			a=100;
			b=100;
			activationBy="ANY";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			text="Basis_West_Klen";
			name="Basis_West_Klen";
			expCond="(player distance Basis_West_Klen) < 100;";
			expActiv="if (playerSide == WEST) then {[Basis_West_Klen] execVM ""safezones\safezone_klen.sqf""}; canbuild = false;";
			expDesactiv="canbuild = true;";
			class Effects
			{
			};
		};
	};
};

repack your pbo and upload.

 

 

Link to comment
Share on other sites

class Sensors
{
items=1;
class Item0
{
position[]={6325.6772,304.99033,7807.7412};
            a=100;                                                                    <-------size
            b=100;                                                                    <-------size

            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="zonestary";
            expCond="(player distance zonestary) < 100;";     <-----size
            expActiv="if (playerSide == WEST) then {[basis_West] execVM ""safezone.sqf""}; TitleText[""Now entering trader city Stary"",""PLAIN DOWN"]; canbuild = false;";
            expDesactiv="TitleText[""Now leaving trader city Stary"",""PLAIN DOWN""]; canbuild = true;";
            class Effects
            {
            };
};
};

 

I did notice the bits in red might be conflicting with each other i think the top 2 set size of the dome/area, and the bottom one too.

 

Maybe 1 or other not both

 

A

Link to comment
Share on other sites

that's how it is in the default epoch file. give me 2 min as i think i have it sorted. the only problem i have now is that its possible to log out while in the trader city but this could be down to my antihack so just going to disable it and see if it happens still.

Link to comment
Share on other sites

  • 1 month later...

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

×
×
  • Create New...