Safe Bases - Almost Complete

sure great that u help me out !!
i really appreciate this!

Code:
// Dome
if ((getPlayerUID player) in [""83401862","228290","123360902","104075206","3911810","92610118""]) exitWith {
titleText ["Welcome to your dome", "PLAIN DOWN", 3];
};
// Everyone Else
titleText ["You are entering a restricted zone, please turn back now or face certain death...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have 1 minute to turn back...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 45 seconds to leave..", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 30 seconds to leave.. We aren't kidding!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 15;
titleText ["You have less than 15 seconds to leave (you're about to die!)...", "PLAIN DOWN", 3];
sleep 15;
titleText ["LAST WARNING , U MAY DIE!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};

exitWith{ .... is ok and you used it correct bur your UID array is wrong, dont use -> "" at the beginning and the end, it has to look like this
Code:
["83401862","228290","123360902","104075206","3911810","92610118"]

plus
the last " }; " is not needed
 
  • Like
Reactions: Fox
Code:
class Sensors
    {
        items=01;
        class Item1
        {
            position[]={4782.6865, 10257.946};
            a=350;
            b=350;
            activationBy="ANY";
            type="SWITCH";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="AdminBase";
            expCond="(vehicle player) in thislist;";
            expActiv="adminbase = [] execVM ""Scripts\dome.sqf"";";
            expDesactiv="terminate adminbase; titleText [""You have left the Admin Base!"", ""PLAIN DOWN"", 3];";
            class Effects
            {
                titleType="TEXT";
                titleEffect="PLAIN DOWN";
                title="You are entering a restricted zone.";
            };
        };
    };

Code:
// Dome
if ((getPlayerUID player) in ["83401862","228290","123360902","104075206","3911810","92610118"]) exitWith {
titleText ["Welcome to your dome", "PLAIN DOWN", 3];
};
// Everyone Else
titleText ["You are entering a restricted zone, please turn back now or face certain death...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have 1 minute to turn back...", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 45 seconds to leave..", "PLAIN DOWN", 3];
sleep 15;
titleText ["You have less than 30 seconds to leave.. We aren't kidding!", "PLAIN DOWN", 3];
removeAllWeapons player;
sleep 15;
titleText ["You have less than 15 seconds to leave (you're about to die!)...", "PLAIN DOWN", 3];
sleep 15;
titleText ["LAST WARNING , U MAY DIE!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
 
  • Like
Reactions: Fox
THANK U !

I'm trying this out right now !

ok seems like it's working to join now .
but the message on joining appears with cannot load mission ,then i click the continue button and its loading and i'm ingame .
strange ,really strange so there must be something that i've to ersae or add something ?!


EDIT: Got the cannot load mission fixed with my scripter [hes online now]

but no one received a message when entering the zone ....
 
Code:
    class Sensors
    {
        items=1;
        class Item0
        {
            position[]={4546.0439,339,10242.657};
            rectangular=1;
            activationBy="ANY";
            repeating=1;
            interruptable=1;
            type="SWITCH";
            age="UNKNOWN";
            text="MyTrigger";
            name="MyTrigger";
            expCond="(vehicle player) in thislist;";
            expActiv="_id = [true,this] execVM ""Leos\burner\zonecheck.sqf"";";
            expDesactiv="_id = [false,this] execVM ""Leos\burner\zonecheck.sqf"";";
            class Effects
            {
            };
        };
    };
this is a trigger that is working fine for me
im wondering about your class Item1 i think the first item should be item0
scnd thing, your position im not sure {x,y} work ... did you try {x,z,y} ?
 
  • Like
Reactions: Fox
this is the separate mission.sqf i've created for the trigger with the editor


Code:
_this = createTrigger ["EmptyDetector", [4768.8872, 10217.75, -339]];
_this setTriggerArea [200, 200, 0, false];
_this setTriggerActivation ["ANY", "PRESENT", true];
_this setSoundEffect ["$NONE$", "", "", "AlarmSfx"];
_trigger_0 = _this;

but i can try getting the position over TSW-Antihack or u have another option in mind?

We have it !
 
you can add a marker at the same position with same size
plus
add
Code:
_this setTriggerType "SWITCH";
to your code

plus
Code:
_this setTriggerStatements [_condition, _activation, _deactivation];
is missing
_condition, _activation, _deactivation are the variables that contain the code

for example
Code:
_condition = "(vehicle player) in thislist";
_activation = "hintsilent ""Entering Trigger ""; cuttext [""Entering Trigger"",""PLAIN DOWN""];";
_deactivation = "hintsilent ""Leaving Trigger""; cuttext [""Leaving Trigger"",""PLAIN DOWN""];";
 
_trigger_0 = createTrigger ["EmptyDetector", [966, 1087, 0]];
_trigger_0 setTriggerActivation ["ANY", "PRESENT", true];
_trigger_0 setTriggerArea [200, 200, 0, false];
_trigger_0 setTriggerType "SWITCH";
_trigger_0 setTriggerText "Trigger1";
_trigger_0 setTriggerStatements [_condition, _activation, _deactivation];
trigger1 = _trigger_0;
 
_marker_0 = createMarker ["triggermarker_1", [966, 1087, 0]];
_marker_0 setMarkerText "triggermarker1";
_marker_0 setMarkerShape "ELLIPSE";
_marker_0 setMarkerType "Flag";
_marker_0 setMarkerBrush "Border";
_marker_0 setMarkerSize [200, 200];
marker1 = _marker_0;
 
  • Like
Reactions: Fox
THX !

U really helped us out so much !

btw where do i have to put in this text as you explained on a later post

Code:
            _directionto = [_unit, vehicle player] call BIS_fnc_dirTo;  //BIS Function to get the direction to the Object entering the Zone
            if(_directionto < 0) then {_directionto = _directionto + 360};  //negative direction to positive
            _positionPlayer = getposATL vehicle player;
            _setNewPos = [getposATL _unit,_directionto,(_radius + 1),true] call FindPosition;  //Custom Script to find the Position outside the Zone in direction of the entering Object
            _setNewPos set [2,(_positionPlayer select 2)];  //adding height
            //cutText ["Enemy Base: " + str(_ShieldID) + " PlayerBaseID: " + str(_playerbaseID) + " DirectionTo: " + str(_directionto) + " NewPos: " +str(_setNewPos), "PLAIN DOWN"];
            cutText ["The Baseshield of this Enemy Base is stronger then you! >_<", "PLAIN DOWN"];  //Info to player
            vehicle player setPos _setNewPos;  //kick out not allowed player or vehicle the player is in
 
Code:
waituntil{player == player};
waitUntil {!isNil "bis_fnc_init"};
 
_condition = "(vehicle player) in thislist";
_activation = "
                cuttext [""Entering Trigger"",""PLAIN DOWN""];
                _directionto = [(trigger1),(vehicle player)] call BIS_fnc_dirTo;
                if(_directionto < 0) then {_directionto = _directionto + 360};
                _positionPlayer = getposATL vehicle player;
                _setNewPos = [trigger1, (200 + 1), _directionto] call BIS_fnc_relPos;
                _setNewPos set [2,(_positionPlayer select 2)];
                vehicle player setPos _setNewPos;
                _velo = (velocity (vehicle player));
                _velo set[0,(((_velo select 0) / 3) * -1)];
                _velo set[1,(((_velo select 1) / 3) * -1)];
                vehicle player setVelocity _velo;
                hintsilent ""Entering Trigger"";
";
_deactivation = "hintsilent ""Leaving Trigger""; cuttext [""Leaving Trigger"",""PLAIN DOWN""];";
 
_trigger_0 = createTrigger ["EmptyDetector", [966, 1087, 0]];
_trigger_0 setTriggerActivation ["ANY", "PRESENT", true];
_trigger_0 setTriggerArea [200, 200, 0, false];
_trigger_0 setTriggerType "SWITCH";
_trigger_0 setTriggerText "Trigger1";
_trigger_0 setTriggerStatements [_condition, _activation, _deactivation];
trigger1 = _trigger_0;
 
_marker_0 = createMarker ["triggermarker_1", [966, 1087, 0]];
_marker_0 setMarkerText "triggermarker1";
_marker_0 setMarkerShape "ELLIPSE";
_marker_0 setMarkerType "Flag";
_marker_0 setMarkerBrush "Border";
_marker_0 setMarkerSize [200, 200];
marker1 = _marker_0;
 
// Player Position Marker //
[] spawn {
    private ["_pos", "_mkr"];
    _pos = getPos player;
    PName = "You";
    _mkr = createMarkerLocal [format ["Plr%1%2", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
    _mkr setMarkerTypeLocal "waypoint";
    _mkr setMarkerSizeLocal [0.5,0.5];
    _mkr setMarkerColorLocal "ColorBlue";
    _mkr setMarkerTextLocal format ["%1", name player];
    _mkr setMarkerTextLocal PName;   
 
    [player, _mkr] spawn {
        private ["_obj", "_marker"];
        _obj = _this select 0;
        _marker = _this select 1;
        while {(alive _obj)} do {
            _marker setMarkerPosLocal (getPos _obj);
            sleep 0.05;
        };
    };
};
// Player Position Marker //
 
  • Like
Reactions: Fox
Sooo im back to this again. I had coded my dome to delete vehicle and worked great for awhile now people can't seem to avoid the domes and are losing vehicles QQ... So im back to trying teleporting... I've tried a few different things and no joy. here is the latest:

Code:
if ((getPlayerUID player) in ["xxxxxxxx"]) exitWith {
titleText ["You are cleared to stay...  Welcome back.", "PLAIN DOWN", 3];
};
// Everyone Else
_unit = _x;
_directionto = [_unit, vehicle player] call BIS_fnc_dirTo;  //BIS Function to get the direction to the Object entering the Zone
if(_directionto < 0) then {_directionto = _directionto + 360};  //negative direction to positive
_positionPlayer = getposATL vehicle player;
_setNewPos = [getposATL _unit,_directionto,(_radius + 1),true] call FindPosition;  //Custom Script to find the Position outside the Zone in direction of the entering Object
_setNewPos set [2,(_positionPlayer select 2)];  //adding height
//cutText ["Enemy Base: " + str(_ShieldID) + " PlayerBaseID: " + str(_playerbaseID) + " DirectionTo: " + str(_directionto) + " NewPos: " +str(_setNewPos), "PLAIN DOWN"];
cutText ["YOU SHOULD BE TELEPORTED NOW!", "PLAIN DOWN"];  //Info to player
vehicle player setPos _setNewPos;  //kick out not allowed player or vehicle the player is in


I also tried a modified version of the anomalies teleport and that did not work as well not to mention i don't want them to teleport across the map just move them back a few feet to stop them from entering. any help? :s
 
Code:
_setNewPos = [getposATL _unit,_directionto,(_radius + 1),true] call FindPosition;  //Custom Script to find the Position outside the Zone in direction of the entering Object
this line will not work for you because 'FindPosition' is my precompiled custom script (as i wrote in my comment...)
thats why your objects will port to anywhere...

but i wonder... didn't you read the last posts in this thread ? in my last post i wrote a full functional 'teleportout'-script based on triggers
Code:
                _directionto = [(trigger1),(vehicle player)] call BIS_fnc_dirTo;
                if(_directionto < 0) then {_directionto = _directionto + 360};
                _positionPlayer = getposATL vehicle player;
                _setNewPos = [trigger1, (200 + 1), _directionto] call BIS_fnc_relPos;
                _setNewPos set [2,(_positionPlayer select 2)];
                vehicle player setPos _setNewPos;
                _velo = (velocity (vehicle player));
                _velo set[0,(((_velo select 0) / 3) * -1)];
                _velo set[1,(((_velo select 1) / 3) * -1)];
                vehicle player setVelocity _velo;
this is a script similar to this one you are unsing
this script is unsing 'BIS_fnc_relPos' instead of 'FindPosition'
plus i added a simple 'kickback'

dont forget to add
Code:
waitUntil {!isNil "bis_fnc_init"};
at scriptstart to check if BIS Functions are loaded
 
Yes i did see that last post but there was no explanation for what it is doing... so i didn't try it. I'm assuming i can not just copy-paste this code? maybe do this?

Code:
if ((getPlayerUID player) in ["xxxxxx"]) exitWith {
titleText ["You are cleared to stay...  Welcome back.", "PLAIN DOWN", 3];
};
waituntil{player == player};
waitUntil {!isNil "bis_fnc_init"};
 
_condition = "(vehicle player) in thislist";
_activation = "
cuttext [""Entering Trigger"",""PLAIN DOWN""];
_directionto = [(trigger1),(vehicle player)] call BIS_fnc_dirTo;
if(_directionto < 0) then {_directionto = _directionto + 360};
_positionPlayer = getposATL vehicle player;
_setNewPos = [trigger1, (200 + 1), _directionto] call BIS_fnc_relPos;
_setNewPos set [2,(_positionPlayer select 2)];
vehicle player setPos _setNewPos;
_velo = (velocity (vehicle player));
_velo set[0,(((_velo select 0) / 3) * -1)];
_velo set[1,(((_velo select 1) / 3) * -1)];
vehicle player setVelocity _velo;
hintsilent ""Entering Trigger"";
";
_deactivation = "hintsilent ""Leaving Trigger""; cuttext [""Leaving Trigger"",""PLAIN DOWN""];";
 
_trigger_0 = createTrigger ["EmptyDetector", [966, 1087, 0]];
_trigger_0 setTriggerActivation ["ANY", "PRESENT", true];
_trigger_0 setTriggerArea [200, 200, 0, false];
_trigger_0 setTriggerType "SWITCH";
_trigger_0 setTriggerText "Trigger1";
_trigger_0 setTriggerStatements [_condition, _activation, _deactivation];
trigger1 = _trigger_0;
 
_marker_0 = createMarker ["triggermarker_1", [966, 1087, 0]];
_marker_0 setMarkerText "triggermarker1";
_marker_0 setMarkerShape "ELLIPSE";
_marker_0 setMarkerType "Flag";
_marker_0 setMarkerBrush "Border";
_marker_0 setMarkerSize [200, 200];
marker1 = _marker_0;
 
// Player Position Marker //
[] spawn {
    private ["_pos", "_mkr"];
    _pos = getPos player;
    PName = "You";
    _mkr = createMarkerLocal [format ["Plr%1%2", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
    _mkr setMarkerTypeLocal "waypoint";
    _mkr setMarkerSizeLocal [0.5,0.5];
    _mkr setMarkerColorLocal "ColorBlue";
    _mkr setMarkerTextLocal format ["%1", name player];
    _mkr setMarkerTextLocal PName; 
 
    [player, _mkr] spawn {
        private ["_obj", "_marker"];
        _obj = _this select 0;
        _marker = _this select 1;
        while {(alive _obj)} do {
            _marker setMarkerPosLocal (getPos _obj);
            sleep 0.05;
        };
    };
};

Feel free to smack me around and call me names in German if i'm completely wrong here :)
 
sorry that i have to say that... but if you dont can read and understand vsb2 you should start with the basics :/
copy/paste is not a permanent solution...

Code:
waituntil{player == player};
waitUntil {!isNil "bis_fnc_init"};
 
AllowedPlayersArray = ["PLAYERUID1","PLAYERUID2"];
 
_condition = "(vehicle player) in thislist";
_activation = "
        if ((getPlayerUID player) in AllowedPlayersArray) then {
            titleText [""You are cleared to stay...  Welcome back."", ""PLAIN DOWN"", 3];
        }else{
            cuttext [""Entering Trigger"",""PLAIN DOWN""];
            _directionto = [(trigger1),(vehicle player)] call BIS_fnc_dirTo;
            if(_directionto < 0) then {_directionto = _directionto + 360};
            _positionPlayer = getposATL vehicle player;
            _setNewPos = [trigger1, (200 + 1), _directionto] call BIS_fnc_relPos;
            _setNewPos set [2,(_positionPlayer select 2)];
            vehicle player setPos _setNewPos;
            _velo = (velocity (vehicle player));
            _velo set[0,(((_velo select 0) / 3) * -1)];
            _velo set[1,(((_velo select 1) / 3) * -1)];
            vehicle player setVelocity _velo;
        };
        hintsilent ""Entering Trigger"";
";
_deactivation = "hintsilent ""Leaving Trigger""; cuttext [""Leaving Trigger"",""PLAIN DOWN""];";
 
_trigger_0 = createTrigger ["EmptyDetector", [966, 1087, 0]];
_trigger_0 setTriggerActivation ["ANY", "PRESENT", true];
_trigger_0 setTriggerArea [200, 200, 0, false];
_trigger_0 setTriggerType "SWITCH";
_trigger_0 setTriggerText "Trigger1";
_trigger_0 setTriggerStatements [_condition, _activation, _deactivation];
trigger1 = _trigger_0;
 
_marker_0 = createMarker ["triggermarker_1", [966, 1087, 0]];
_marker_0 setMarkerText "triggermarker1";
_marker_0 setMarkerShape "ELLIPSE";
_marker_0 setMarkerType "Flag";
_marker_0 setMarkerBrush "Border";
_marker_0 setMarkerSize [200, 200];
marker1 = _marker_0;
 
// Player Position Marker //
[] spawn {
    private ["_pos", "_mkr"];
    _pos = getPos player;
    PName = "You";
    _mkr = createMarkerLocal [format ["Plr%1%2", _pos select 0, _pos select 1], [(_pos select 0) + 20, _pos select 1, 0]];
    _mkr setMarkerTypeLocal "waypoint";
    _mkr setMarkerSizeLocal [0.5,0.5];
    _mkr setMarkerColorLocal "ColorBlue";
    _mkr setMarkerTextLocal format ["%1", name player];
    _mkr setMarkerTextLocal PName;
 
    [player, _mkr] spawn {
        private ["_obj", "_marker"];
        _obj = _this select 0;
        _marker = _this select 1;
        while {(alive _obj)} do {
            _marker setMarkerPosLocal (getPos _obj);
            sleep 0.05;
        };
    };
};

this code needs to run at mission start
maybe call this script in your init.sqf
 
@leolilu working perfectly thank you for the help! would have lost my brain trying to figure it out on my own! <3
 
@leolilu one more tiny little question? the 966, 1087, 0 is database location system or 3D editor? or 2D editor? I may solve it on my own in a few by testing as well.
 
Players are reporting that if they enter a trigger zone of a base that they're not listed on, even when exiting, they still die from the "player setDamage 1;" command.

Players fly helicopters through the trigger zone, and the timer still counts down while they're miles away from the trigger radius.

This is a serious issue, and I need a fix ASAP.

Also, players who die in the trigger zone, respawn outside the trigger zone, or near it. I need this to not happen.

Also, certain players are allowed to bypass the "if ((getPlayerUID player) in" list, even when their ID is not listed there. I have public people running around in protected bases, stealing, and destroying my donators vehicles.

Please help me with this.
 
your code would be helpfull ^^

triggers have one big problem, they fire only one time on enter and on leave
if you ware able to cross the border without activating the trigger (coz of lag or whatever) , you are safe in it
thats why a trigger isnt the best solution for a safe base
but its not necessary to use the activate or deactivate action to trigger a script

you can run a loop that check if a player is near that trigger
a check each second should more than ok and will not stress client or server
Code:
while{alive player} do {
  if (((vehicle player) distance Triggername) < 200) then {
    kill-, teleport- or whatever-script....
  };
  sleep 1;
}
orthis should work on server side
Code:
while{time > 2} do {
  {
     if(isPlayer _x) then {
        kill-, teleport- or whatever-script....
     };
     sleep 0.01;
  }foreach (position Triggername) nearEntities [["Man","AllVehicles"],200];
sleep 1;
}
 
your code would be helpfull ^^

triggers have one big problem, they fire only one time on enter and on leave
if you ware able to cross the border without activating the trigger (coz of lag or whatever) , you are safe in it
thats why a trigger isnt the best solution for a safe base
but its not necessary to use the activate or deactivate action to trigger a script

you can run a loop that check if a player is near that trigger
a check each second should more than ok and will not stress client or server
Code:
while{alive player} do {
  if (((vehicle player) distance Triggername) < 200) then {
    kill-, teleport- or whatever-script....
  };
  sleep 1;
}
orthis should work on server side
Code:
while{time > 2} do {
  {
    if(isPlayer _x) then {
        kill-, teleport- or whatever-script....
    };
    sleep 0.01;
  }foreach (position Triggername) nearEntities [["Man","AllVehicles"],200];
sleep 1;
}


Code:
  class Item0
        {
            position[]={9845.4043,0,3606.3677};
            a=200;
            b=200;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="AdminBase";
            expCond="(vehicle player) in thislist;";
            expActiv="AdminBase = [] execVM ""Scripts\adminbase.sqf"";";
            expDesactiv="terminate AdminBase; titleText [""You have left the Admin Base!"", ""PLAIN DOWN"", 3];";
            class Effects
            {
            };

Code:
if ((getPlayerUID player) in ["16600710","101263750","106387654","107404550","83484998","124084422","123512326","122971078"]) then {
titleText ["Hello Admin.  Welcome back.", "PLAIN DOWN", 3];
} else {
titleText ["This is a protected base, leave now, or perish!", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have 15 seconds to turn back...", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have less than 10 seconds to leave.", "PLAIN DOWN", 3];
sleep 5;
titleText ["You were warned..!", "PLAIN DOWN", 3];
sleep 5;
player setDamage 1;
};


I'm using the standard code provided in this thread.

Where do you want me to place this looping trigger?
 
hm... i wonder how your trigger works without defining type = "SWITCH"; ....:eek:
redefining the variable 'AdminBase' could make some trouble too because you defined the triggername 'AdminBase' and the script as 'AdminBase' so the trigger object will be overwritten
please change the script variable :)

here is a litle script that you can copy paste to your init.sqf, near end will be i good place i think
this will work with a object named 'AdminBase' (trigger, marker or whatever has this name)
it will kickback players that are entering the zone
Code:
[] spawn {
    waitUntil {!isNil "bis_fnc_init"};
    while{alive player} do {
        if (((vehicle player) distance AdminBase) < 200) then {
            if ((getPlayerUID player) in ["16600710","101263750","106387654","107404550","83484998","124084422","123512326","122971078"]) then {
                hintsilent format["You are allowed!"];
            }else{
                cuttext [">_<","PLAIN DOWN"];
                _directionto = [(AdminBase),(vehicle player)] call BIS_fnc_dirTo;
                if(_directionto < 0) then {_directionto = _directionto + 360};
                _positionPlayer = getposATL vehicle player;
                _setNewPos = [AdminBase, (200 + 1), _directionto] call BIS_fnc_relPos;
                _setNewPos set [2,(_positionPlayer select 2)];
                vehicle player setPos _setNewPos;
                _velo = (velocity (vehicle player));
                _velo set[0,(((_velo select 0) / 3) * -1)];
                _velo set[1,(((_velo select 1) / 3) * -1)];
                vehicle player setVelocity _velo;
            };
        };
        sleep 1;
    };
};
 
Back
Top