Jump to content

[RELEASE] Dome access RPT logger


Randomness

Recommended Posts

Access Logging Dome Script

Note: You will need to know what your doing to install this.

Credit to Axe Cop and infistar for helping me figure some stuff out 

 

Features:

  • Does NOT kill players that enter the dome!
  • Allows the server admin to "protect" bases while the base owners are offline, by logging dome access to the server report file.
  • Prevents building/logging out inside the dome for players who are not whitelisted when the owners of the dome are offline.
  • Does none of this when the owners are online (on our server, they have to defend their own turf).

 

The actual Dome Script (ie: MPMission / scripts / dome.sqf):

private ["_owners","_name","_ownerOnline","_baseOwner"];

//List of owners
_baseOwner = "Randomness"; //Define a name for this area
_owners = ["314515521"]; //Array of owners of this area

_ownerOnline = false;
_name = name player;

// Check if the player IS one of the owners
if ((getPlayerUID player) in _owners) exitWith {
titleText [format ["Welcome, %1", _name], "PLAIN DOWN", 4]; // welcomes you with your name
};

// Check if one of the owners is online
{
diag_log format ["[Dome] Currently Processing admin with puid: %1", _x];
        if (_x call fnc_isPlayerOnline) exitWith {
            _ownerOnline = true;
diag_log format ["[Dome] base owner with puid: %1 is online", _x];
        };
} foreach _owners;

if (!_ownerOnline) exitWith {    // What happens if unauthorized players get into the dome
titleText ["Approaching donator base! Do not harm this base while the owners are offline! Activity is logged!", "PLAIN DOWN", 4];

//Disabling building and logging out for dome visitors
canbuild = false;

        //Activating logging function
        dome_WriteLog = [_name, _baseOwner];
        publicVariableServer "dome_WriteLog";
};

    if (_ownerOnline) exitWith {
canbuild = false;
        titleText ["Woof Woof! Watch out, the guard dogs spotted you!", "PLAIN DOWN", 4];
    };

A trigger for this dome in mission.sqm:

Note: of course all these coordinates and stuff require some editing

class Item6
        {
            position[]={13960.541,1.148,7940.4688};
            a=120;
            b=120;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="sensor_1";
            expCond="(player distance sensor_1) < 120;";
expActiv="dome_1 = [] execVM ""scripts\dome.sqf"";";
expDesactiv="terminate dome_nnnl; titleText [""You have left the dome"", ""PLAIN DOWN"", 4]; canbuild=true;";
            class Effects
            {
            };
        };

Inside the MPMission init.sqf or somewhere where its run serverside:

if (isServer) then {
"dome_WriteLog" addPublicVariableEventHandler {
        _data = _this select 1;
        diag_log format ["[DOME] Player %1 accessed %2 base at %3",_data select 0, _data select 1, time];
    };
};

Instance / Battleye / publicVariable.txt

 

In the line containing 5 "" , at the end add !="dome_WriteLog"

 

 

(optional) for Infistar antiHack, inside AH.sqf:

 

Find:

                } forEach ['allUnits','entities','allMissionObjects','vehicles','playableUnits'];

replace with:

                } forEach ['allUnits','entities','allMissionObjects','vehicles'];

Enjoy

Link to comment
Share on other sites

I might edit this a bit so it actually teleports people that try to enter the dome when the owners are offline, so they get teleported back somewhere instead of just logging it (lack of time to go argue with people that destroyed stuff etc and pretend not to have done it and help repay the owners)... But ye really great work!!

( I hope you allow me to edit it that way? I will give you credit of course in my server credits ;) )

Link to comment
Share on other sites

I might edit this a bit so it actually teleports people that try to enter the dome when the owners are offline, so they get teleported back somewhere instead of just logging it (lack of time to go argue with people that destroyed stuff etc and pretend not to have done it and help repay the owners)... But ye really great work!!

( I hope you allow me to edit it that way? I will give you credit of course in my server credits ;) )

 

You can edit it for that, but i dont see why you would log access if you are already teleporting them out of the dome :)

Link to comment
Share on other sites

  • 2 weeks later...

Excuse me, but where do i find that function: fnc_isPlayerOnline ??? I cant see where it is defined  in the code...my u can give me a hint which script is called once _x calls it? regards

Link to comment
Share on other sites

Excuse me, but where do i find that function: fnc_isPlayerOnline ??? I cant see where it is defined  in the code...my u can give me a hint which script is called once _x calls it? regards

 

Sorry i forgot to add that apparantly:

 

This is in my MPMission init:

if (!isDedicated) then {
    
	//Customized functions
	//Check if a Player is online by its PlayerUID
	fnc_isPlayerOnline = 
	{
		private ["_uid", "_isOnline"];
		_uid = _this;
		_isOnline = false;
		{
			if (isPlayer _x and {_uid == getPlayerUID _x}) exitWith {
				diag_log format ["[Dome] Found owner with uid = %1,", getPlayerUID _x];
				_isOnline = true;
			};
		} foreach playableUnits;
		_isOnline
	};
	 
};
Link to comment
Share on other sites

 

Sorry i forgot to add that apparantly:

 

This is in my MPMission init:

if (!isDedicated) then {
    
	//Customized functions
	//Check if a Player is online by its PlayerUID
	fnc_isPlayerOnline = 
	{
		private ["_uid", "_isOnline"];
		_uid = _this;
		_isOnline = false;
		{
			if (isPlayer _x and {_uid == getPlayerUID _x}) exitWith {
				diag_log format ["[Dome] Found owner with uid = %1,", getPlayerUID _x];
				_isOnline = true;
			};
		} foreach playableUnits;
		_isOnline
	};
	 
};

Thanks! I am working on  a extension to protect bases...means that storage objects will be locked down if player is near and owner not online

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Hey!

First things first!

Very cool Idea and good job!

 

But i run int a problem and im a "very beginner scripter"

 

i use "Savezonecommander" and this script uses the same "Sensor class" as ur script.

Now is everyone who i did not tag friendly in GOD Mode when he enter my Dome because Savezonecommander think there is a Trader Zone.

 

I tryed this.

//  --------------------------------Domes START------------------------------------          
        class Item10
        {

            position[]={7726.65,289.948,5175.2};
            a=45;
            b=45;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="sensor_1";
            expCond="(player distance sensor_1) < 45;";
            expActiv="dome_1 = [] execVM ""scripts\dome.sqf""; canbuild = true;
            expDesactiv="terminate dome_nnnl; titleText [""You have left the dome! Good luck on your way!"", ""PLAIN DOWN"", 4]; canbuild=true;
            class Effects
            {
            };
        };      
//------------------------------Domes End-----------------------------------------------  

 

I hoped because the canbuild "Savezonecomander" dont activate the "Savezone" but it didnt work!

 

Anyone can give me a solution.

 

THX

Link to comment
Share on other sites

  • 4 months later...

Hey!

First things first!

Very cool Idea and good job!

 

But i run int a problem and im a "very beginner scripter"

 

i use "Savezonecommander" and this script uses the same "Sensor class" as ur script.

Now is everyone who i did not tag friendly in GOD Mode when he enter my Dome because Savezonecommander think there is a Trader Zone.

 

I tryed this.

//  --------------------------------Domes START------------------------------------          

        class Item10

        {

            position[]={7726.65,289.948,5175.2};

            a=45;

            b=45;

            activationBy="WEST";

            repeating=1;

            interruptable=1;

            age="UNKNOWN";

            name="sensor_1";

            expCond="(player distance sensor_1) < 45;";

            expActiv="dome_1 = [] execVM ""scripts\dome.sqf""; canbuild = true;

            expDesactiv="terminate dome_nnnl; titleText [""You have left the dome! Good luck on your way!"", ""PLAIN DOWN"", 4]; canbuild=true;

            class Effects

            {

            };

        };      

//------------------------------Domes End-----------------------------------------------  

 

I hoped because the canbuild "Savezonecomander" dont activate the "Savezone" but it didnt work!

 

Anyone can give me a solution.

 

THX

try this 

 class Item10
        {

            position[]={7726.65,289.948,5175.2};
            a=45;
            b=45;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="sensor_1";
            expCond="(player distance sensor_1) < 45;";
            expActiv="dome_1 = [] execVM ""scripts\dome.sqf""; canbuild = true;inSaveZone = false;";
            expDesactiv="terminate dome_nnnl; titleText [""You have left the dome! Good luck on your way!"", ""PLAIN DOWN"", 4]; canbuild=true;inSaveZone = false;";
            class Effects
            {
            };
        };    

 

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