Randomness Posted February 18, 2014 Report Share Posted February 18, 2014 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 xBowBii 1 Link to comment Share on other sites More sharing options...
peipo118 Posted February 18, 2014 Report Share Posted February 18, 2014 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 More sharing options...
Randomness Posted February 18, 2014 Author Report Share Posted February 18, 2014 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 More sharing options...
peipo118 Posted February 19, 2014 Report Share Posted February 19, 2014 Well i would remove the logging but i like how you check if the owners are online or not, well done! ;) Link to comment Share on other sites More sharing options...
loki Posted March 1, 2014 Report Share Posted March 1, 2014 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 More sharing options...
Randomness Posted March 4, 2014 Author Report Share Posted March 4, 2014 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 }; }; loki 1 Link to comment Share on other sites More sharing options...
Guest Posted March 5, 2014 Report Share Posted March 5, 2014 What are these coords? position[]={13960.541,1.148,7940.4688}; <-- x, y, z? Link to comment Share on other sites More sharing options...
loki Posted March 6, 2014 Report Share Posted March 6, 2014 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 More sharing options...
GiantUnicorn Posted March 16, 2014 Report Share Posted March 16, 2014 Is it possible to get this script to write a msg to the owner of the dome if his security is breached? Link to comment Share on other sites More sharing options...
peipo118 Posted March 18, 2014 Report Share Posted March 18, 2014 Working ob that right now ;) will release if i get it working properly Link to comment Share on other sites More sharing options...
peipo118 Posted March 18, 2014 Report Share Posted March 18, 2014 Working ob that right now ;) will release if i get it working properly Link to comment Share on other sites More sharing options...
GiantUnicorn Posted March 18, 2014 Report Share Posted March 18, 2014 thanks. is it possible to make the script write to its own .rpt file? Then use an external script that will scan the files for changes and email the player if someones goes into their base. Link to comment Share on other sites More sharing options...
Uncle Bad Touch Posted May 26, 2014 Report Share Posted May 26, 2014 Does this include the dome or just the script to teleport players who are close to it? If it is just a tele script could you link the dome aswell? Link to comment Share on other sites More sharing options...
sisquo007 Posted June 1, 2014 Report Share Posted June 1, 2014 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 More sharing options...
Rythron Posted October 28, 2014 Report Share Posted October 28, 2014 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 More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now