Welcome to The Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies and more


How do you go about making Safe Zones in epoch?


m1ke909

Recommended Posts

  • 1 month later...

This adds safezones to all trader cities, airplane, bandit and hero traders.

 

Original script credit to maca134 http://dayzepoch.com...-safezone-maybe

 

Replace sensors with this in mission.sqm

 

class Sensors
{
	items=9;
	class Item0
	{
		position[]={4053.8501,364.76645,11668.645};
		activationBy="WEST";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zonebash";
		expCond="(player distance zonebash) < 75;";
		expActiv="TitleText[""Now entering trader city Bash"",""PLAIN DOWN""]; canbuild = false;";
		expDesactiv="TitleText[""Now leaving trader city Bash"",""PLAIN DOWN""]; canbuild = true;";
		class Effects
		{
			soundDet="arabian_market_1";
		};
	};
	class Item1
	{
		position[]={11463.747,317.3078,11349.89};
		activationBy="WEST";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zoneklen";
		expCond="(player distance zoneklen) < 75;";
		expActiv="TitleText[""Now entering trader city Klen"",""PLAIN DOWN""]; canbuild = false;";
		expDesactiv="TitleText[""Now leaving trader city Klen"",""PLAIN DOWN""]; canbuild = true;";
		class Effects
		{
			soundDet="arabian_market_1";
		};
	};
	class Item2
	{
		position[]={6325.6772,304.99033,7807.7412}; 
		activationBy="WEST";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zonestary";
		expCond="(player distance zonestary) < 75;";
		expActiv="TitleText[""Now entering trader city Stary"",""PLAIN DOWN""]; canbuild = false;";
		expDesactiv="TitleText[""Now leaving trader city Stary"",""PLAIN DOWN""]; canbuild = true;";
		class Effects
		{
			soundDet="arabian_market_1";
		};
	};
       class Item3
	{
		position[]={4053.8501,364.76645,11668.645};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zonebash_safezone";
		expCond="(player distance zonebash_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
	};
	class Item4
	{
		position[]={11463.747,317.3078,11349.89};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zoneklen_safezone";
		expCond="(player distance zoneklen_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
	};
	class Item5
	{
		position[]={6325.6772,304.99033,7807.7412};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zonestary_safezone";
		expCond="(player distance zonestary_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
       };
	class Item6
	{
		position[]={1606.6443,289.70795,7803.5156};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="bandit_safezone";
		expCond="(player distance bandit_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
       };
	class Item7
	{
		position[]={12944.227,210.19823,12766.889};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="Hero_safezone";
		expCond="(player distance Hero_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
       };
	class Item8
	{
		position[]={12060.471,158.85699,12638.533};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="Aircraft_safezone";
		expCond="(player distance Aircraft_safezone) < 100;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
       };		

};
};

 

Create a file called safezone.sqf in your mission folder

 

Paste this in

 

 

Private ["_EH_Fired"];

if (isNil "inSafezone") then {
   inSafezone = false;
};

while {true} do {
   waitUntil { inSafeZone };
   titleText [format["Entering Trader Area - God Mode Enabled"],"PLAIN DOWN"]; titleFadeOut 4;

   waitUntil { player == vehicle player };

   thePlayer = vehicle player;
   _EH_Fired = thePlayer addEventHandler ["Fired", {
       titleText ["You can not fire your weapon in a Trader City Area","PLAIN DOWN"]; titleFadeOut 4;
       NearestObject [_this select 0,_this select 4] setPos[0,0,0];
   }];

   player_zombieCheck = {};
   fnc_usec_damageHandler = {};
   thePlayer removeAllEventHandlers "handleDamage";
   thePlayer addEventHandler ["handleDamage", {false}];
   thePlayer allowDamage false;

   waitUntil { !inSafeZone };

   titleText [format["Exiting Trader Area - God Mode Disabled"],"PLAIN DOWN"]; titleFadeOut 4;
   thePlayer removeEventHandler ["Fired", _EH_Fired];

   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";
   thePlayer addEventHandler ["handleDamage", {true}];
   thePlayer removeAllEventHandlers "handleDamage";
   thePlayer allowDamage true;
};

 

Add this to the bottom of your init.sqf

 

 

[] execVM "safezone.sqf";

Share this post


Link to post
Share on other sites

This adds safezones to all trader cities, airplane, bandit and hero traders.

 

Original script credit to maca134 http://dayzepoch.com...-safezone-maybe

 

Replace sensors with this in mission.sqm

 

class Sensors
{
	items=9;
	class Item0
	{
		position[]={4053.8501,364.76645,11668.645};
		activationBy="WEST";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zonebash";
		expCond="(player distance zonebash) < 75;";
		expActiv="TitleText[""Now entering trader city Bash"",""PLAIN DOWN""]; canbuild = false;";
		expDesactiv="TitleText[""Now leaving trader city Bash"",""PLAIN DOWN""]; canbuild = true;";
		class Effects
		{
			soundDet="arabian_market_1";
		};
	};
	class Item1
	{
		position[]={11463.747,317.3078,11349.89};
		activationBy="WEST";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zoneklen";
		expCond="(player distance zoneklen) < 75;";
		expActiv="TitleText[""Now entering trader city Klen"",""PLAIN DOWN""]; canbuild = false;";
		expDesactiv="TitleText[""Now leaving trader city Klen"",""PLAIN DOWN""]; canbuild = true;";
		class Effects
		{
			soundDet="arabian_market_1";
		};
	};
	class Item2
	{
		position[]={6325.6772,304.99033,7807.7412}; 
		activationBy="WEST";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zonestary";
		expCond="(player distance zonestary) < 75;";
		expActiv="TitleText[""Now entering trader city Stary"",""PLAIN DOWN""]; canbuild = false;";
		expDesactiv="TitleText[""Now leaving trader city Stary"",""PLAIN DOWN""]; canbuild = true;";
		class Effects
		{
			soundDet="arabian_market_1";
		};
	};
       class Item3
	{
		position[]={4053.8501,364.76645,11668.645};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zonebash_safezone";
		expCond="(player distance zonebash_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
	};
	class Item4
	{
		position[]={11463.747,317.3078,11349.89};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zoneklen_safezone";
		expCond="(player distance zoneklen_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
	};
	class Item5
	{
		position[]={6325.6772,304.99033,7807.7412};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="zonestary_safezone";
		expCond="(player distance zonestary_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
       };
	class Item6
	{
		position[]={1606.6443,289.70795,7803.5156};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="bandit_safezone";
		expCond="(player distance bandit_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
       };
	class Item7
	{
		position[]={12944.227,210.19823,12766.889};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="Hero_safezone";
		expCond="(player distance Hero_safezone) < 150;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
       };
	class Item8
	{
		position[]={12060.471,158.85699,12638.533};
		activationBy="ANY";
		repeating=1;
		interruptable=1;
		age="UNKNOWN";
		name="Aircraft_safezone";
		expCond="(player distance Aircraft_safezone) < 100;";
		expActiv="inSafeZone = true;";
		expDesactiv="inSafeZone = false;";
		class Effects
		{

		};
       };		

};
};

 

Create a file called safezone.sqf in your mission folder

 

Paste this in

 

 

Private ["_EH_Fired"];

if (isNil "inSafezone") then {
   inSafezone = false;
};

while {true} do {
   waitUntil { inSafeZone };
   titleText [format["Entering Trader Area - God Mode Enabled"],"PLAIN DOWN"]; titleFadeOut 4;

   waitUntil { player == vehicle player };

   thePlayer = vehicle player;
   _EH_Fired = thePlayer addEventHandler ["Fired", {
       titleText ["You can not fire your weapon in a Trader City Area","PLAIN DOWN"]; titleFadeOut 4;
       NearestObject [_this select 0,_this select 4] setPos[0,0,0];
   }];

   player_zombieCheck = {};
   fnc_usec_damageHandler = {};
   thePlayer removeAllEventHandlers "handleDamage";
   thePlayer addEventHandler ["handleDamage", {false}];
   thePlayer allowDamage false;

   waitUntil { !inSafeZone };

   titleText [format["Exiting Trader Area - God Mode Disabled"],"PLAIN DOWN"]; titleFadeOut 4;
   thePlayer removeEventHandler ["Fired", _EH_Fired];

   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";
   thePlayer addEventHandler ["handleDamage", {true}];
   thePlayer removeAllEventHandlers "handleDamage";
   thePlayer allowDamage true;
};

 

Add this to the bottom of your init.sqf

 

 

[] execVM "safezone.sqf";

Share this post


Link to post
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...