Jump to content
  • 0

Custom protection dome not working


UngarMax

Question

Hello there,

 

I had been searching for a script to protect my admin's base, so unauthorized players would be killed. After a little bit of research, I had found the following tutorial (which has a syntax mispell I already fixed: rectangle=1). I've followed all the steps, and created a sensor (which is actually a trigger in Arma 2's Map Editor), whose code I added to mission.sqm:

class Item5
{
	position[]={1261.4967,4688.3843,-140.78297};
	a=150;
        b=150;
	rectangle=1;
        activationBy="ANY";
        repeating=1;
        interruptable=1;
        age="UNKNOWN";
        name="dome";
        expCond="(vehicle player) in thislist;";
	expActiv="dome = [] execVM ""dome.sqf"";";
        expDesactiv="terminate dome; titleText [""You have left the Admin Dome."", ""PLAIN DOWN"", 3];";
	class Effects
	{
	        titleType="TEXT";
		titleEffect="PLAIN DOWN";
		title="If you see this, the xxx dome script isn't working right now but the intrusion sensor is!";
	};
};

I've verified that class Sensor's items is set to 6 (the fifth sensors are DayZ Epoch's default ones, which make the Trader Cities work), so the custom sensor I added is the sixth and, therefore, the item's number is correct. The dome.sqf file content is the following:

// Dome
if ((getPlayerUID player) in ["123456789"]) exitWith {
titleText ["Welcome to the Admin Dome!", "PLAIN DOWN", 3];
};
// Everyone Else
titleText ["This dome is an Admin-only area, please leave immediately.", "PLAIN DOWN", 3];
sleep 5;
titleText ["If you do not turn back you will be killed.", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have 10 seconds!", "PLAIN DOWN", 3];
sleep 5;
titleText ["You must leave now!", "PLAIN DOWN", 3];
sleep 5;
titleText ["You were warned!", "PLAIN DOWN", 3];
sleep 3;
player setDamage 1;

The issue with the script is that it isn't showing me the welcome text nor killing me when any unauthorized user access the base (triggers the sensor). Do you have any solution to fix this issue?

 

Thanks in advance!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Try this for your sensor. The format for positions in sensors  is X,Z,Y with Z the height and it should be activationBy="WEST";

class Item5
{
	position[]={1261.4967,1,4688.3843};
	a=150;
        b=150;
	rectangle=1;
        activationBy="WEST";
        repeating=1;
        interruptable=1;
        age="UNKNOWN";
        name="dome";
        expCond="(vehicle player) in thislist;";
	expActiv="dome = [] execVM ""dome.sqf"";";
        expDesactiv="terminate dome; titleText [""You have left the Admin Dome."", ""PLAIN DOWN"", 3];";
	class Effects
	{
	        titleType="TEXT";
		titleEffect="PLAIN DOWN";
		title="If you see this, the xxx dome script isn't working right now but the intrusion sensor is!";
	};
};

Also for the dome.sqf you could replace your welcome message with this to welcome the admin by his/her name :D

// Dome
if ((getPlayerUID player) in ["123456789"]) exitWith {
//titleText ["Welcome to the Admin Dome!", "PLAIN DOWN", 3];
titleText [format ["Welcome to the Admin Dome, %1", name player], "PLAIN DOWN"]; // welcomes you with your name
};
// Everyone Else
titleText ["This dome is an Admin-only area, please leave immediately.", "PLAIN DOWN", 3];
sleep 5;
titleText ["If you do not turn back you will be killed.", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have 10 seconds!", "PLAIN DOWN", 3];
sleep 5;
titleText ["You must leave now!", "PLAIN DOWN", 3];
sleep 5;
titleText ["You were warned!", "PLAIN DOWN", 3];
sleep 3;
player setDamage 1;

I have this working for a admin island on my lingor server and my sensor and dome.sqf looks like this. 

        class Item9
        {
            position[]={938.557,1,9276.32};
            a=400;
            b=400;
            rectangular=1;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="domeone";
            expCond="(vehicle player) in thislist;";
            expActiv="domeone = [] execVM ""Scripts\domes\domeone.sqf"";";
            expDesactiv="terminate domeone;[] execVM ""Scripts\domes\domexit.sqf"";";
            class Effects
            {
            };
	};

No syntax error with rectangular=1; and i use two different dome.sqf. One for each activate/deactivate.

 

My domeone.sqf

if ((getPlayerUID player) in ["76561198031095962" , "76561198040815950"]) exitWith { 
//titleText ["Welcome Home", "PLAIN DOWN", 3]; //or,\\
			_object = player;
			player_zombieCheck = {};
			fnc_usec_damageHandler = {};
			fnc_usec_unconscious  = {};
			_object allowDamage false; 
titleText [format ["Welcome Home, %1", name player], "PLAIN DOWN"]; // welcomes you with your name
};
// What happens if unauthorized players get into the dome
titleText ["You Are Entering A Restricted Zone", "PLAIN DOWN", 3];
sleep 5;
titleText ["You Will Be Excuted in 15 seconds", "PLAIN DOWN", 3];
sleep 5;
titleText ["Turn Back Now or Face Certain Death", "PLAIN DOWN", 3];
sleep 5;
titleText ["You Have 5 Seconds To Comply", "PLAIN DOWN", 3];
sleep 5;
titleText ["You Will Now Be Excuted", "PLAIN DOWN", 3];
sleep 1;
player setDamage 1;

My domexit.sqf

if ((getPlayerUID player) in ["76561198031095962" , "76561198040815950"]) exitWith { 
			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;
titleText [format ["You Have Left Admin Island, %1", name player], "PLAIN DOWN"];			
};
titleText ["You Have Left The Restricted Area", "PLAIN DOWN", 3];

domeone.sqf when player(s) enter will give god mode to the player(s) in the list, welcome the player(s) in the list and warn/kill player(s) not in the list that enter and stay to long.

domexit.sqf when player(s) exit will take away god mode from player(s) in the list, let the player(s) in the list know they left the zone, and let the player(s) not in the list know they left the restricted zone.

Cheers

Link to comment
Share on other sites

  • 0

Hello:

 

Wow! Lots of thanks! Had been 2 days trying to find out what was wrong and I couldn't! By the way, thanks for sharing your amazing dome script (so I can give god mode to players in base and such). That weird format position makes no sense at all, tho.

 

Do you actually know if I could get the UUID from the MySQL Database by searching for the username or any similar way to do it?

 

Much appreciated!  :)

Link to comment
Share on other sites

  • 0

Hello:

 

Wow! Lots of thanks! Had been 2 days trying to find out what was wrong and I couldn't! By the way, thanks for sharing your amazing dome script (so I can give god mode to players in base and such). That weird format position makes no sense at all, tho.

 

Do you actually know if I could get the UUID from the MySQL Database by searching for the username or any similar way to do it?

 

Much appreciated!  :)

NP man glad to share. Yes you can get a players UID from player_data in your database. Just search the players name and copy the PlayerUID. It will be a 17 digit number.

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

×
×
  • Create New...