Jump to content
  • 0

Safezone God Mode for All Trading Posts?


icor1031

Question

18 answers to this question

Recommended Posts

  • 0

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

 

Original script credit to maca134 http://dayzepoch.com/forum/index.php?/topic/386-better-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";
Link to comment
Share on other sites

  • 0

Add this to the bottom of your init.sqf

[] execVM "safezone.sqf";

 

 

Remove [] before execVM, otherwise the server gets stuck at "Waiting for Host."

 

 

 

I don't suppose you can tell me how to allow logout in trader city area?

 

 

Thanks.

 

 

EDIT: Hmm, odd. I just found another script that used [] before exec. I'm starting to think the code I was given for towing is bad, and it's breaking all of the others.


Link to comment
Share on other sites

  • 0

Can someone tell me why there are 2 sensors for the 3 trader cities?  and has anyone got the hero trader to work?

 

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 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
            {
                
            
};
        };

Link to comment
Share on other sites

  • 0

I have updated to Epoch 1.0.4 and have run in to a problem - previously we have in the mission.sqm removed safezone from Hero and Bandit.

But in the new mission.sqm there is no reference to Hero or Bandit as far as I can see - anyone have been able to remove safezone from Hero and Bandit on Epoch 1.0.4 ? How?

EDIT: After having a closer look at this - it looks like godmode is not turning on in any places - I can't read programming code, but i guess its has to do with the change in the mission.sqm

Any thoughts on how to fix this ?

Link to comment
Share on other sites

  • 0
class Sensors
	{
		items=6;
		class Item0
		{
			position[]={6325.6772,304.99033,7807.7412};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonestary";
			expCond="(player distance zonestary) < 100;";
			expActiv="[""trader city Stary"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""trader city Stary"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item1
		{
			position[]={4063.4226,365.00577,11664.19};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonebash";
			expCond="(player distance zonebash) < 100;";
			expActiv="[""trader city Bash"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""trader city Bash"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item2
		{
			position[]={11447.472,317.26886,11364.504};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zoneklen";
			expCond="(player distance zoneklen) < 100;";
			expActiv="[""trader city Klen"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""trader city Klen"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item3
		{
			position[]={1606.6443,289.70795,7803.5156};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonebandit";
			expCond="(player distance zonebandit) < 100;";
			expActiv="[""Bandit Trader"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Bandit Trader"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item4
		{
			position[]={12944.227,210.19823,12766.889};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonehero";
			expCond="(player distance zonehero) < 100;";
			expActiv="[""Hero Trader"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Hero Trader"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
		class Item5
		{
			position[]={1259.88,2398.1,0.00143242};
			a=100;
			b=100;
			activationBy="WEST";
			repeating=1;
			interruptable=1;
			age="UNKNOWN";
			name="zonekamenka";
			expCond="(player distance zonekamenka) < 100;";
			expActiv="[""Kamenka Trader"",true,""enter""] spawn player_traderCity;";
			expDesactiv="[""Kamenka Trader"",true,""leave""] spawn player_traderCity;";
			class Effects
			{
			};
		};
	};
};

This isent working, whats wrong pliz help!

Link to comment
Share on other sites

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...