Jump to content

Extended Safezone Script - Working!


Friendly

Recommended Posts

 

No luck with this one :(

 

The sensors are working when not running the safezone.sqf . As soon as i run it I get kicked for this 

17.03.2015 22:43:40: Robin (121.211.2.116:2304) d7f022269a06bc9f0681db3927447f36 - #19 "H", "_safeZoneFiredEH"];
waitUntil {
inSafeZone
};
player allowDamage false;
_safeZoneDamageEH = player addEventhandler["HandleD"

and this is my script.txt removeeventhandler

7 removeEventHandler !="displayRemoveEventHandler" !"_currentTarget  removeEventHandler[\"EpeContactStart\", _onContactEH]" !" [_adminVar,objnull];\npublicvariable _adminVar;\nplayer removeeventhandler [\"respawn\",_respawn];" !"player removeEventhandler["HandleDamage", _safeZoneDamageEH];"

adding the following didn't help too.

!"player allowDamage false;" !"player allowDamage true;"

I really want this to work, as I don't want to set up 9 25m areas around each safe zone :(

you added !="player allowDamage false;" !="player allowDamage true;" to line 20 right, try it with this instead lol      

!"player allowDamage false;" !"player allowDamage true;"
Link to comment
Share on other sites

 

you added !="player allowDamage false;" !="player allowDamage true;" to line 20 right, try it with this instead lol      

!"player allowDamage false;" !"player allowDamage true;"

 

Derp! haha its working now! 

 

Thank you so much Friendly.

 

Quick question is there a way to stop shooting from outside to inside?

Link to comment
Share on other sites

Derp! haha its working now! 

 

Thank you so much Friendly.

 

Quick question is there a way to stop shooting from outside to inside?

not that I know of, but if someone shoots someone that is inside of the zone that is injured from outside the zone it will heal the person inside and they will not be killed.

Link to comment
Share on other sites

is there a way to delete shots from player vehicles? Tried a hunter with GMG (grenades) from inside the safe zone. Grenades did not get deleted and they killed my test subject. Didn't have time to test more vehicles because of other players nearby (not info I want them knowing).

Link to comment
Share on other sites

is there a way to delete shots from player vehicles? Tried a hunter with GMG (grenades) from inside the safe zone. Grenades did not get deleted and they killed my test subject. Didn't have time to test more vehicles because of other players nearby (not info I want them knowing).

I would assume I can figure it out, haven't worked on anything but player vs player damage yet.

Link to comment
Share on other sites

Rob, glad it worked since you need to setup a Hella lot of them protection zones to cover the gaps they leave when repeating them.....I spent a long time on it back in November.

Friendly and anyone else.

Both Donkey Punch servers run full vehicle and player safe zone scripting, thanks in part to Friendly and the a2 and a3 community here.

BTW Friendly HI!!!!

I'm not holding anything back, those that know how to will find it those that don't maybe friendly will snatch it up and share it but it's a pretty easy add to the current code.

I too have been working on the speed limit but with no vehicles able to run people over anymore it's now low on my priority list.

Link to comment
Share on other sites

I don't appear to be able to get this to work. I've edited the locations for chernarus and added a safezone to include the boat-trader, but it doesn't show anything on map or bring up any messages.

 

Here's my mission.sqm:

 

https://dl.dropboxusercontent.com/u/86154888/mission.sqm

 

Anyone able to shed any light on why its not working for us?

 

Are my co-ordinates wrong for where I want the safezones in the mission.sqm? Do the co-ordinates work differently there to in the config.cpp in the a3_epoch_server_settings.pbo?

Link to comment
Share on other sites

  • 2 weeks later...

	private ["_objects"];
_objects = [


    ["ProtectionZone_Invisible_F",[23710.1, 16250.1, 0.01]], 
    ["ProtectionZone_Invisible_F",[23710.1, 16225.1, 0.01]], 	
    ["ProtectionZone_Invisible_F",[23710.1, 16200.1, 0.01]],	
    ["ProtectionZone_Invisible_F",[23685.1, 16250.1, 0.01]],
    ["ProtectionZone_Invisible_F",[23685.1, 16225.1, 0.01]],
    ["ProtectionZone_Invisible_F",[23685.1, 16200.1, 0.01]],	
    ["ProtectionZone_Invisible_F",[23660.1, 16250.1, 0.01]], 
    ["ProtectionZone_Invisible_F",[23660.1, 16225.1, 0.01]], 
    ["ProtectionZone_Invisible_F",[23660.1, 16200.1, 0.01]] 
	
];

{
	private ["_obj"];
	_obj = createVehicle [_x select 0, [0,0,0], [], 0, "CAN_COLLIDE"];
	_obj setvectorup [0,0,1];	
	_obj setPosATL (_x select 1);
} foreach _objects;	

 

Add in altis.h in propsPos[] = { }; ?

Link to comment
Share on other sites

Hello

need help
Player get banned (except admins) by enterig the save zone trigger for:
example:
31-03-2015 14:52:41 infiSTAR.de | 0h 10min | [AVS] Hacu() BANNED | EH_HandleDamage 2: 5 should be 4 (v0137)
 

And in my battleye / scripts txt (don´t realy konw if its the right file)
 

Line 20

1 allowDamage !"player allowDamage false;" !"player allowDamage true;" !="if(!isPlayer _x)then{_x allowDamage"

 

Line 58

1 removeEventHandler !"_currentTarget  removeEventHandler[\"EpeContactStart\", _onContactEH]" !" [_adminVar,objnull];\npublicvariable _adminVar;\nplayer removeeventhandler [\"respawn\",_respawn];" !"player removeEventhandler["HandleDamage", _safeZoneDamageEH];"

 

 

In my Run
/*  revert allowDamage   */ _RAD = false; /* true or false */ /* if you have safezones using "player allowDamage false;" or similar.. set _RAD = false; */
/*  HandleDamage check   */ _HDC = false; /* true or false */ /* *experimental + Epoch only* - probably publicVariableServer spam but no more godmode hackers. */
/*  Revert HandleDamage  */ _RHD = true; /* true or false */ /* Needs to be  false  for Paintball script */
/*  Use EH_Fired check   */ _EHF = false; /* true or false */ /* Some mods revert the EventHandlers by default and can cause problems with this check. Tested on Epoch and AltisLife. */
/*  custom fired handler */ _customFiredEventhandler = {}; /* this needs to be CODE */
/*  Remove Hit Handler   */ _REH = true; /* true or false */ /* Needs to be  false  for Paintball script */
/*  Revert InventoryOpen */ _RIO = true; /* true or false */ /* Sets the custom InventoryOpened Handler for AltisLife only - don't mind this option if you are on a different mod. */
/*  "" Respawn Handler   */ _RRH = true; /* true or false */ /* Needs to be  false  for some custom loadout scripts */

 

 

 

Hope you can help me

Atom_Monky

Link to comment
Share on other sites

Hello

need help

Player get banned (except admins) by enterig the save zone trigger for:

example:

31-03-2015 14:52:41 infiSTAR.de | 0h 10min | [AVS] Hacu() BANNED | EH_HandleDamage 2: 5 should be 4 (v0137)

 

And in my battleye / scripts txt (don´t realy konw if its the right file)

 

 

 

In my Run

 

 

Hope you can help me

Atom_Monky

try turning the following false
/*  revert allowDamage   */ _RAD = true;	/* true or false */	/* if you have safezones using "player allowDamage false;" or similar.. set _RAD = false; */
/*  HandleDamage check   */ _HDC = false;	/* true or false */	/* *experimental + Epoch only* - probably publicVariableServer spam but no more godmode hackers. */
/*  Revert HandleDamage  */ _RHD = true;	/* true or false */	/* Needs to be  false  for Paintball script */
/*  Use EH_Fired check   */ _EHF = true;	/* true or false */	/* Some mods revert the EventHandlers by default and can cause problems with this check. Tested on Epoch and AltisLife. */

Link to comment
Share on other sites

Hi Guys and thanks for this script. But i have an issue. I have Altis Map and a 4th Respawnpoint (Tradercity) and when i put in the coordinates in mission.sqm it wont work?

class Sensors
{
items=4;
class Item0
{
position[]={18459.535,23.616171,14277.782};
a=250;
b=250;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="eastsafezone";
expCond = "(player distance eastsafezone) < 250;";
expActiv="hint ""You have entered A Safe Zone! Do not fire in Safe Zones.""; inSafeZone = true;";
expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
class Effects
{
};
};
class Item1
{
position[]={6195.4927,89.220779,16839.254};
a=250;
b=250;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="westsafezone";
expCond = "(player distance westsafezone) < 250;";
expActiv="hint ""You have entered A Safe Zone! Do not fire in Safe Zones.""; inSafeZone = true;";
expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
class Effects
{
};
};
class Item2
{
position[]={13334.093,2.2350941,14517.924}; //14939.934,0.053499073,15083.272
a=250;
b=250;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="centralsafezone";
expCond = "(player distance centralsafezone) < 250;";
expActiv="hint ""You have entered A Safe Zone! Do not fire in Safe Zones.""; inSafeZone = true;";
expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
class Effects
{
};
};
class Item3
{
position[]={21180.80,5070.00,14510.211}; //22292.8,5075.05,14517.924
a=250;
b=250;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="safezone";
expCond = "(player distance safezone) < 250;";
expActiv="hint ""You have entered A Safe Zone! Do not fire in Safe Zones.""; inSafeZone = true;";
expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
class Effects
{
};
};
};
}; 

What did i wrong?

Can someone help? Thanks in advance

 

Tony

Link to comment
Share on other sites

Hi Guys and thanks for this script. But i have an issue. I have Altis Map and a 4th Respawnpoint (Tradercity) and when i put in the coordinates in mission.sqm it wont work?

class Sensors
{
items=4;
class Item0
{
position[]={18459.535,23.616171,14277.782};
a=250;
b=250;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="eastsafezone";
expCond = "(player distance eastsafezone) < 250;";
expActiv="hint ""You have entered A Safe Zone! Do not fire in Safe Zones.""; inSafeZone = true;";
expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
class Effects
{
};
};
class Item1
{
position[]={6195.4927,89.220779,16839.254};
a=250;
b=250;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="westsafezone";
expCond = "(player distance westsafezone) < 250;";
expActiv="hint ""You have entered A Safe Zone! Do not fire in Safe Zones.""; inSafeZone = true;";
expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
class Effects
{
};
};
class Item2
{
position[]={13334.093,2.2350941,14517.924}; //14939.934,0.053499073,15083.272
a=250;
b=250;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="centralsafezone";
expCond = "(player distance centralsafezone) < 250;";
expActiv="hint ""You have entered A Safe Zone! Do not fire in Safe Zones.""; inSafeZone = true;";
expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
class Effects
{
};
};
class Item3
{
position[]={21180.80,5070.00,14510.211}; //22292.8,5075.05,14517.924
a=250;
b=250;
activationBy="ANY";
repeating=1;
interruptable=1;
age="UNKNOWN";
name="safezone";
expCond = "(player distance safezone) < 250;";
expActiv="hint ""You have entered A Safe Zone! Do not fire in Safe Zones.""; inSafeZone = true;";
expDesactiv="hint ""You are leaving the Safe Zone!""; inSafeZone = false;";
class Effects
{
};
};
};
}; 

What did i wrong?

Can someone help? Thanks in advance

 

Tony

I believe you have to delete the 4th  }; should only be 3 but I could be wrong.

Link to comment
Share on other sites

Hi lambn001,

 

yeah i know what you mean. But i have 4 Spawnpoints and want the 4th to be also triggerd like the others but it wont work. The other 3 are working properly.

 

Just need assistence for the 4th Spawn (and i wanna know why its not working)

 

But Thank U

 

Greetings

Link to comment
Share on other sites

Hi lambn001,

 

yeah i know what you mean. But i have 4 Spawnpoints and want the 4th to be also triggerd like the others but it wont work. The other 3 are working properly.

 

Just need assistence for the 4th Spawn (and i wanna know why its not working)

 

But Thank U

 

Greetings

 

Have you made a marker called 'safezone' at the same location as the sensor?

Link to comment
Share on other sites

Yeah sure

class Markers
{
items = 4;
class Item0
{
position[] = {14939.934,0.053499073,15083.272};
name = "center";
type = "Empty";
};
class Item1
{
position[] = {23600.639,3.19,18000.72};
name = "respawn_east";
type = "Empty";
};
class Item2
{
position[] = {23600.611,3.19,18000.768};
name = "respawn_west";
type = "Empty";
};
class Item3
{
position[] = {22273.4,5093.55,10000.72};
name = "savezone";
type = "Empty";
};
};

Dont know what to do to make it work.

Link to comment
Share on other sites

Yeah sure

class Markers
{
items = 4;
class Item0
{
position[] = {14939.934,0.053499073,15083.272};
name = "center";
type = "Empty";
};
class Item1
{
position[] = {23600.639,3.19,18000.72};
name = "respawn_east";
type = "Empty";
};
class Item2
{
position[] = {23600.611,3.19,18000.768};
name = "respawn_west";
type = "Empty";
};
class Item3
{
position[] = {22273.4,5093.55,10000.72};
name = "savezone";
type = "Empty";
};
};

Dont know what to do to make it work.

 

In the marker it is called 'savezone' but you refer to it as 'safezone' in the trigger, they both need to be the same.

Link to comment
Share on other sites

Thanks Second for the info but can you show me an example because i looked in the sqf called from the init but there is no trigger`?!?!?

if (isNil "inSafezone") then {

    inSafezone = false;
};
while {
    true
}
do {
    private["_safeZoneDamageEH", "_safeZoneFiredEH"];
    waitUntil {
        inSafeZone
    };
    player allowDamage false;
    _safeZoneDamageEH = player addEventhandler["HandleDamage",{false}];
    _safeZoneFiredEH = player addEventHandler ["Fired", {
   deleteVehicle (_this select 0);
titleText["You can not fire your weapon in a safe zone.", "PLAIN DOWN"];
        titleFadeOut 4;
    }];
    waitUntil {
        !inSafeZone
    };
    player allowDamage true;
    player removeEventhandler["HandleDamage", _safeZoneDamageEH];
    player removeEventHandler["Fired", _safeZoneFiredEH];
};

Link to comment
Share on other sites

 

Thanks Second for the info but can you show me an example because i looked in the sqf called from the init but there is no trigger`?!?!?

if (isNil "inSafezone") then {

    inSafezone = false;
};
while {
    true
}
do {
    private["_safeZoneDamageEH", "_safeZoneFiredEH"];
    waitUntil {
        inSafeZone
    };
    player allowDamage false;
    _safeZoneDamageEH = player addEventhandler["HandleDamage",{false}];
    _safeZoneFiredEH = player addEventHandler ["Fired", {
   deleteVehicle (_this select 0);
titleText["You can not fire your weapon in a safe zone.", "PLAIN DOWN"];
        titleFadeOut 4;
    }];
    waitUntil {
        !inSafeZone
    };
    player allowDamage true;
    player removeEventhandler["HandleDamage", _safeZoneDamageEH];
    player removeEventHandler["Fired", _safeZoneFiredEH];
};

 

 

The sensors in your mission.sqm are the trigger.

 

The sensor is looking for a marker called safezone:

expCond = "(player distance safezone) < 250;";

 

but your marker is called savezone, so it never triggers:

You need to change

class Item3
{
position[] = {22273.4,5093.55,10000.72};
name = "savezone";
type = "Empty";
};

 

to 

class Item3
{
position[] = {22273.4,5093.55,10000.72};
name = "safezone";
type = "Empty";
};
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
×
×
  • Create New...