[Release] Safezones

easy fix back up your scripts.txt. Then delete the file scripts.txt. Then when you have a real solution add it back in fixed.
 
Thanks machine that gives me a little bit of times (not long becuase i'd rather not run without battleye for long AT ALL) but at least people won't get in trouble with battleye until someone helps me find a real solution. :)
 
ive tried using the kill zombies in a certain distance for this. but didnt work. anyone know why?

Code:
//Base protection for Players with Eventhandler
//
//requires Trigger with activation BLUEFOR and OPFOR with name Basis_West and Basis_East
//
// you can't fire out of your own Base
//
//Those who hit or kill Enemy in it's Base, will be killed
//
// Parameters: [name of the side trigger for the Base Area]
//
//Center_West:
//if (playerSide == WEST) then {[Basis_West] execVM "safezone.sqf"};
//
//Center_East:
//if (playerSide == EAST) then {[Basis_East] execVM "safezone.sqf"};
 
 
Private ["_Basis","_EH_Fired","_EH_Hit","_EH_Killed","_zombies","_zombie"];
 
 
_Basis = _this select 0; //Basisname
 
while {true} do
  {
    //wait until Player is in base, then start Eventhandler
    waitUntil {vehicle player in list _Basis};
    player groupchat "i am in Baseshield! (cannot kill or be killed) ";
    _EH_Fired  = vehicle player addEventHandler ["Fired", { NearestObject [_this select 0,_this select 4] setPos[0,0,0]}];
    _EH_Hit    = vehicle player addEventHandler ["Hit",  {_this select 1 setdammage 1; player setDammage 0; vehicle player setDammage 0}];
    _EH_Killed = vehicle player addEventHandler ["Killed",{_this select 1 setdammage 1}];
sleep 10;
 
 
_zombies = (getPosATL _Basis) nearEntities ["zZombie_Base",120];
        _count = count _zombies;
   
        for "_i" from 0 to (_count -1) do {
            _zombie = _zombies select _i;
            _zombie setdamage 1;
            sleep 0.01;
        };
 
 
 
 
    //wait until Player left base, then delete EventHandler
    waitUntil {! (vehicle player in list _Basis)};
    player groupchat "i have left Baseshield! (can kill or be killed)";
    player removeEventHandler ["Fired", _EH_Fired];
    player removeEventHandler ["Hit",  _EH_Hit];
    player removeEventHandler ["Killed",_EH_Killed];
  }
 
I use Epoch Mod Server Files which I would bet on are based on Lite Files. However I managed to get it work with felixberndt help to execute it only serverside with a not common solution.

Maybe I can figure out of this another solution will try this later and if it works I will rearrange the starting post :)

Reread the starting post and the whole thread.....

How would we go about removing Player2's knock out ability from safe zones with this? Also How would one bring a dog into this area without it being teleported/despawned. And lastly, one bug with this is that any armed vehicle that drives in the zone, will not be able to shoot for the rest of server lifetime until a reset. It basically fires blanks, just like the players do whilst inside the safe zone, even when it leaves the zone all together.
 
How would we go about removing Player2's knock out ability from safe zones with this? Also How would one bring a dog into this area without it being teleported/despawned. And lastly, one bug with this is that any armed vehicle that drives in the zone, will not be able to shoot for the rest of server lifetime until a reset. It basically fires blanks, just like the players do whilst inside the safe zone, even when it leaves the zone all together.


most likely its because the exit trigger doesnt work right. this script needs work just wait for it to be fixed, or try to fix it yourself haha. This script has made me cry inside...
 
Well, this is still working with 1.7.7 but the problem is this new "wild zedz" in 1.7.7. I now have zedz spawning in my safezone, where they never spawned before. There are no buildings that spawn loot in or around my safe zone. I guess a way will need to be found to block zedz from spawning in the zone?
 
Well, this is still working with 1.7.7 but the problem is this new "wild zedz" in 1.7.7. I now have zedz spawning in my safezone, where they never spawned before. There are no buildings that spawn loot in or around my safe zone. I guess a way will need to be found to block zedz from spawning in the zone?

Yeah, I agree. I get the same problem.
 
Here is another idea to prevent players from shooting instead of set damage:

In the 3D Editor it works fine, but it does not work in MP, and i have no clue why ...
but maybe a solution for the vehicle weapons which still make damage with the old script...

Code:
private ["_eh1","_inArea","_pos","_unit","_zone1","_zone2","_dis"];
 
_unit = _this select 0;
 
_zone1 = getMarkerPos "zone1"; // marker name for the areas you want to protect
_zone2 = getMarkerPos "zone2";
_dis = 200;                            // distance from area safe zone starts
 
 
 
if ((_zone1 distance _unit > _dis) or (_zone2 distance _unit > _dis)) then {        //check if unit is in zone when script starts
  _inArea = false;
}else{
  _inArea = true;
  _eh1 = _unit addEventHandler ["fired", {deleteVehicle (_this select 6);}];
};
 
 
 
while {true} do {
 
 
  if (((_zone1 distance _unit < _dis) or (_zone2 distance _unit < _dis)) && (!_inArea)) then {      // check if unit enters
 
      _eh1 = _unit addEventHandler ["fired", {deleteVehicle (_this select 6);}];
      _inArea = true;
      hint "safe zone";
  };
 
 
  if (((_zone1 distance _unit > _dis) or (_zone2 distance _unit > _dis)) && (_inArea)) then {      // check if unit exits
 
      _unit removeEventHandler ["fired", _eh1];
      _inArea = false;
      hint "You just left the safe zone";
  };
 
sleep 5;
 
};
 
Hi guys,

there is no need to change anything about the fired handler because there already is a safezoneobject in arma2

Code:
class Item721
        {
            position[]={4051.0706,362.95001,11633.16};
            id=825;
            side="EMPTY";
            vehicle="Protectionzone_EP1";
            skill=1;
            init="this setObjectTexture [0,'#(argb,8,8,3)color(0,0,0,0,ca)'];";           
        };

Within this Object weapons cannot cause any damage.
The Object is a cylinder with 25m diameter. If you want to make it visible just delete the init line
 
So anyone figured out the wild zed spawning problem? It's just really annoying.
Atm we use a script like this:
Code:
if ((getPlayerUID player) in ["XXXXXUID"]) then {
titleText ["You are entering a restricted zone....identity confirmed. Welcome back.", "PLAIN DOWN", 3];
} else {
titleText ["You are entering a restricted zone, please turn back now or face certain death...", "PLAIN DOWN", 3];
sleep 5;
titleText ["You have less than 5 seconds to leave (you're about to die!)...", "PLAIN DOWN", 3];
sleep 5;
titleText ["You were warned..!", "PLAIN DOWN", 3];
sleep 1;
player setDamage 1;
};
Is there a way to put a zombiekiller/teleporter in here? Or maybe in another script that is executed every 10 secs but where you can set more than one position.
 
1.7.7.1 I see a red sphere where I placed the safezone, not getting any text warnings when leaving or entering, and if I am flying and press f10 or f9 (to record and take screenshots using fraps) it moves my player camera to a stationary spot on the ground where I no longer have the ability to control anything. And it stays like that until I eject from the heli
Edit: Also happens when driving a car.
 
Is there a way to put a zombiekiller/teleporter in here? Or maybe in another script that is executed every 10 secs but where you can set more than one position.

There is a zombiekiller in ALKINDA's Post #65 beginning with _zombies
 
1.7.7.1 I see a red sphere where I placed the safezone, not getting any text warnings when leaving or entering, and if I am flying and press f10 or f9 (to record and take screenshots using fraps) it moves my player camera to a stationary spot on the ground where I no longer have the ability to control anything. And it stays like that until I eject from the heli
Edit: Also happens when driving a car.

Im getting the same problem, anyone know how to fix it.
 
This is what i have for my safe zone:
(works for Item3, not 4 :s )

MISSION.SQM (class sensors)

class Item3
{
position[]={1730.9734,20,5057.0127};
a=70;//Width of the dome
b=80;//Hight of the dome
rectangular=1;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="admindome1";
expCond="(vehicle player) in thislist;";
expActiv="admindome1 = [] execVM ""domes\dome1.sqf"";";
expDesactiv="terminate admindome1; titleText [""You've left the base"", ""PLAIN DOWN"", 3];";
};
class Item4
{
position[]={1996.5505,20,5212.5522};
a=150;//Width of the dome
b=80;//Hight of the dome
rectangular=1;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="admindome2";
expCond="(vehicle player) in thislist;";
expActiv="admindome2 = [] execVM ""domes\dome2.sqf"";";
expDesactiv="terminate admindome2; titleText [""You've left the desertbase"", ""PLAIN DOWN"", 3];";
};

___________________________________________________________________
And inside the domes folder with dome1.sqf:
(with XXXX being the player uid)

_playerUID = getPlayerUID player;

if (_playerUID in ["XXXXX","XXXX"]) then
{
titleText ["Welcome home", "PLAIN DOWN", 3]
} else {
titleText ["You are entering restricted area, leave.", "PLAIN DOWN", 3];
sleep 5;
titleText ["GET OUT", "PLAIN DOWN", 3];
sleep 5;
removeAllWeapons player;
titleText ["TOLD YA", "PLAIN DOWN", 3];
sleep 10;
removeAllItems player;
titleText ["THAT SUCKS", "PLAIN DOWN", 3];
sleep 10;
titleText ["Good night.", "PLAIN DOWN", 3];
sleep 1;
player setDamage 1;
};

__________________________________________________________________

This is fully working for dome1, but not dome 2 :(
 
This is what i have for my safe zone:
(works for Item3, not 4 :s )

MISSION.SQM (class sensors)

class Item3
{
position[]={1730.9734,20,5057.0127};
a=70;//Width of the dome
b=80;//Hight of the dome
rectangular=1;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="admindome1";
expCond="(vehicle player) in thislist;";
expActiv="admindome1 = [] execVM ""domes\dome1.sqf"";";
expDesactiv="terminate admindome1; titleText [""You've left the base"", ""PLAIN DOWN"", 3];";
};
class Item4
{
position[]={1996.5505,20,5212.5522};
a=150;//Width of the dome
b=80;//Hight of the dome
rectangular=1;
activationBy="WEST";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="admindome2";
expCond="(vehicle player) in thislist;";
expActiv="admindome2 = [] execVM ""domes\dome2.sqf"";";
expDesactiv="terminate admindome2; titleText [""You've left the desertbase"", ""PLAIN DOWN"", 3];";
};

___________________________________________________________________
And inside the domes folder with dome1.sqf:
(with XXXX being the player uid)

_playerUID = getPlayerUID player;

if (_playerUID in ["XXXXX","XXXX"]) then
{
titleText ["Welcome home", "PLAIN DOWN", 3]
} else {
titleText ["You are entering restricted area, leave.", "PLAIN DOWN", 3];
sleep 5;
titleText ["GET OUT", "PLAIN DOWN", 3];
sleep 5;
removeAllWeapons player;
titleText ["TOLD YA", "PLAIN DOWN", 3];
sleep 10;
removeAllItems player;
titleText ["THAT SUCKS", "PLAIN DOWN", 3];
sleep 10;
titleText ["Good night.", "PLAIN DOWN", 3];
sleep 1;
player setDamage 1;
};

__________________________________________________________________

This is fully working for dome1, but not dome 2 :(

That's for domes, not safe zones xD Also: It looks like it should work, so long as you have the total item count as 5 (take the last item number you have, say item4, and add 1 (there is always and item0!))
 
For admins who want's to have fun with users that won't listen to the warnings and don't want them just to die : http://community.bistudio.com/wiki/setVelocity. You may want to remove weapons and items from the player before executing this to let them feel the real pain when they get to their body and it's empty.

Edit: Here is a video which shows the results:
 
Back
Top