Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
//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.
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?
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;
};
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)'];";
};
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.
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![]()
yep, double checked that, still not loading though...