Jump to content
  • 0
Sign in to follow this  
DangerRuss

In Search of Anti-Zombie/Vehicle God mode for trader zones.. using AGN

Question

Ive been using AGN, and I really like it, except for 2 things.. the zombies running around knocking into you and generally being a nuisance, AND the fact that vehicles inside the trade zone are vulnerable to damage.

 

We get some trolls occasionally that like to shoot rockets into the trader zones or ram their vehicle into other vehicles. Also occasionally DZMS spawns the missions right outside of stary and they shoot rockets into the trader zones.

 

I tried using SARGE's old zed nuker, which works fine on my vanilla dayz server, but doesn't seem to do anything on the epoch server.

http://opendayz.net/threads/zed-nuker-script.11230/

 

Can anyone point me in the right direction? Thanks.

Share this post


Link to post
Share on other sites

17 answers to this question

Recommended Posts

  • 0

 

 

here you go, never tested it but ive seen someone else using it.

Ah yes, this confuses me slightly because Im not sure how to either add it to my existing safezone script, or "run it as a separate script in the safezone trigger."  Could you point me in the right direction? Thanks

Share this post


Link to post
Share on other sites
  • 0

Ah yes, this confuses me slightly because Im not sure how to either add it to my existing safezone script, or "run it as a separate script in the safezone trigger."  Could you point me in the right direction? Thanks

Rename the scripts to like nozeds.sqf instead of clearzeds.sqf

Share this post


Link to post
Share on other sites
  • 0

That goes over my head man. That format doesn't look like anything in the AGN so Im having a hard time trying to understand and piece it together myself. If it looked similar I might be able to figure it out, but the way it's written Im just really confused. Thanks for trying to help.

Share this post


Link to post
Share on other sites
  • 0

Im just confused on how to implement this with AGN. I dont see any obvious place to put this because of the format of the script...I feel like this would have to be it's on script apart from AGN, similar to how I implement the zed free zones, and then new sensors created in the missions.sqm?

Share this post


Link to post
Share on other sites
  • 0

Not sure whats there that would help me..

I have an anti zombie thing working fine in the safe zones. I have a AGN working fine. Im using the indestructible locked vehicles as a temporary solution the the vehicle problem but I'd still love a vehicle god mode in safe zones.

Share this post


Link to post
Share on other sites
  • 0

 hmm i tried this and with the below line also maybe i put it somewhere wrong any closer where to details ebay?

when i tried it didnt work but didnt break any other functions of the safe zone

/*
 * Safezone Commander Script by AlienX
 * www.opendayz.net
 * Thanks to everyone who has provided other scripts of the same format, without you I would not have been able to make this.
 */

diag_log ( "[AGN] Starting Trader City Safezone Commander!" );
 
if ( isDedicated || isServer ) exitWith {diag_log ( "Error: Attempting to start AGN products on a server where it should not be!" );}; 

Private ["_EH_Fired","_ehID","_fix","_inVehicle","_inVehicleLast","_EH_Fired_Vehicle","_inVehicleDamage","_antiBackpackThread","_antiBackpackThread2","AGN_safeZoneGodmode","AGN_safeZoneMessages","AGN_safeZone_Backpack_AllowGearFromLootPiles","AGN_safeZone_Backpack_AllowGearFromVehicles","AGN_safeZone_Backpack_AllowGearFromDeadPlayers","AGN_safeZone_Vehicles_DisableMountedGuns","AGN_safeZone_Players_DisableWeaponFiring","AGN_safeZone_Backpack_EnableAntiBackpack","AGN_safeZone_Vehicles_AllowGearFromWithinVehicles","_anti_zombie","_vehicle","_veh_array","_y","_veh_total"];


//SCRIPT SETTINGS
AGN_safeZoneDebug = false; //Debug notes on screen.
AGN_safeZoneGodmode = true; 								//Should safezone Godmode be enabled?
AGN_safeZoneMessages = true;								//Should players get messages when entering and exiting the safe zone?
AGN_safeZone_Backpack_EnableAntiBackpack = true;			//Should players not be able to take from peoples bags?
AGN_safeZone_Backpack_AllowGearFromLootPiles = true;		//Should players be able to loot from loot piles?
AGN_safeZone_Backpack_AllowGearFromVehicles = false;		//Should players be able to loot from a vehicles gear?
AGN_safeZone_Backpack_AllowGearFromDeadPlayers = true;		//Should players be able to loot from a dead players corpse?
AGN_safeZone_Backpack_AllowFriendlyTaggedAccess = true;	//Should players who are tagged friendly be able to access eachothers bags?
AGN_safeZone_Vehicles_DisableMountedGuns = true;			//Should players not be able to shoot bullets/projectiles from mounted guns?
AGN_safeZone_Vehicles_AllowGearFromWithinVehicles = true;	//Should players be able to open the gear screen while they are inside a vehicle?
AGN_safeZone_Players_DisableWeaponFiring = true;			//Should players not be able to shoot bullets/projectiles from their weapon(s)?
AGN_safeZone_Players_RemoveZombies= true;				//Players allowed to delete zombies while in safe zone?

//Probs not needed, but meh :)
disableSerialization;

waitUntil {!isNil "dayz_animalCheck"};
if ( AGN_safeZoneMessages ) then { systemChat ( "" ); };

_inVehicle = objNull;
_inVehicleLast = objNull;

while {true} do {
	
	waitUntil { !canBuild };

	_inSafezoneFinished = false;
	if ( AGN_safeZoneMessages ) then { systemChat ("Entering Trader Area - God Mode Enabled"); };
	_thePlayer = player;
	
	if ( AGN_safeZoneGodmode ) then
	{
		player_zombieCheck = {};
		fnc_usec_damageHandler = {};
		_thePlayer removeAllEventHandlers "handleDamage";
		_thePlayer addEventHandler ["handleDamage", {false}];
		_thePlayer allowDamage false;
		_inVehicle allowDamage false;
		{_x allowDamage false} forEach (nearestObjects [thisTrigger,["Building","LandVehicle","Air"], 100]);
	};

	if ( AGN_safeZone_Players_RemoveZombies ) then
	{
		_anti_zombie = [] spawn {
		private ["_entity_array"];
			while {!canBuild} do
			{
				_entity_array = (getPos player) nearEntities ["CAManBase",110];
				{
					if (_x isKindof "zZombie_Base") then {
						deletevehicle _x;
					};
				} forEach _entity_array;
				sleep 4;
			};
		};
	};

	if ( AGN_safeZone_Players_DisableWeaponFiring ) then
	{
		_EH_Fired = _thePlayer addEventHandler ["Fired", {
			systemChat ("You can not fire your weapon in a Trader City Area");
			NearestObject [_this select 0,_this select 4] setPos[0,0,0];
		}];
	};
	
	if ( AGN_safeZone_Backpack_EnableAntiBackpack ) then
	{
		AGN_LastPlayerLookedAt = objNull;
		AGN_LastPlayerLookedAtCountDown = 5;
		_antiBackpackThread = [] spawn {
			private [ "_ct","_ip","_ia","_dis"] ;
			while {!canBuild} do
			{
				if ( isNull AGN_LastPlayerLookedAt ) then
				{
					waitUntil {!isNull cursorTarget};
					_ct = cursorTarget;
					_ip = isPlayer _ct;
					if ( _ip ) then { _ia = alive _ct; _dis = _ct distance player; } else { _ia = false; _dis = 1000; };
					
					if ( (_ip && _ia) && (_dis < 6.5) ) then
					{
						AGN_LastPlayerLookedAt = _ct;
					};
				} else {
					AGN_LastPlayerLookedAtCountDown = AGN_LastPlayerLookedAtCountDown - 1;
					if ( AGN_LastPlayerLookedAtCountDown < 0 ) then { AGN_LastPlayerLookedAtCountDown = 5; AGN_LastPlayerLookedAt = objNull; };
					sleep 1;
				};
			};
		};
			
		_antiBackpackThread2 = [] spawn {
			private ["_to","_dis","_inchk","_ip","_ia","_skip","_ct","_iv","_lp","_inv","_ctOwnerID","_friendlies","_if"];
			_ctOwnerID = 0;
			while {!canBuild} do
			{
				_ct = cursorTarget;
				_skip = false;
				
				if ( !isNull (_ct) ) then
				{
					_to = typeOf _ct;
					_dis = _ct distance player;
					_inchk = ["WeaponHolder","ReammoBox"];
					
					_lp = false;
					{
						if ( (_to isKindOf _x) && (_dis < 10) && AGN_safeZone_Backpack_AllowGearFromLootPiles ) then
						{
							_lp = true;
						};
					} forEach ( _inchk );

					_ip = isPlayer _ct;
					_ia = alive _ct;
					_iv = _ct isKindOf "AllVehicles";
					_inv = (vehicle player != player);
					
					_if = false;
					if ( _ip ) then {
						_ctOwnerID = _ct getVariable["CharacterID","0"];
						_friendlies	= player getVariable ["friendlyTo",[]];
						if(_ctOwnerID in _friendlies) then {	
							if ( AGN_safeZone_Backpack_AllowFriendlyTaggedAccess ) then
							{
								_if = true;
							};
						};
					};
					if ( AGN_safeZoneDebug ) then {
					hintSilent ( format["AGN Safezone Commander\n\nCursorTarget\n%1\n\nDistance\n%2\n\nLootpile\n%3 [%9]\n\nisPlayer\n%4\n\nAlive\n%5\n\nisVehicle\n%6\n\ninVehicle\n%7\n\nisFriendly\n%8 (%12) [%10]\n\nSkip: %11\n",
                                                _ct, _dis, _lp, _ip, _ia, _iv, _inv, _if, AGN_safeZone_Backpack_AllowGearFromLootPiles, AGN_safeZone_Backpack_AllowFriendlyTaggedAccess, _skip, _ctOwnerID] );
};

					
					//Lootpile check
					if ( _lp ) then {_skip = true;};
					
					//Dead body check
					if ( !(_ia) && AGN_safeZone_Backpack_AllowGearFromDeadPlayers ) then {_skip = true;};
					
					//Vehicle check
					if ( _iv && (_dis < 10) && !(_ip) && AGN_safeZone_Backpack_AllowGearFromVehicles ) then {_skip = true;};
					
					//In a vehicle check
					if ( _inv && AGN_safeZone_Vehicles_AllowGearFromWithinVehicles ) then { _skip = true; };
					
					//Is player friendly?
					if ( _if ) then { _skip = true; };
				};
				
				if( !isNull (FindDisplay 106) && !_skip ) then
				{
					if ( isNull AGN_LastPlayerLookedAt ) then
					{
						(findDisplay 106) closeDisplay 1;
						waitUntil { isNull (FindDisplay 106) };
						createGearDialog [(player), 'RscDisplayGear'];
						if ( AGN_safeZoneMessages ) then { systemChat ("Anti Backpack Stealing - Redirecting you to your own gear!"); };
						waitUntil { isNull (FindDisplay 106) };
					} else {
						if ( AGN_safeZoneMessages ) then { systemChat (format["You cannot open your gear at this time as you have looked at a player in the last 5 seconds."]); };
						(findDisplay 106) closeDisplay 1;
						waitUntil { isNull (FindDisplay 106) };
					};
				};
				if ( _skip && _if ) then {
					if ( AGN_safeZoneMessages ) then { systemChat ("This player is tagged friendly, you have access to this players bag") };
				};
			};
		};
	};
	
	if ( AGN_safeZone_Vehicles_DisableMountedGuns ) then
	{
		while { !canBuild } do
		{
			sleep 0.1;
			if ( !(isNull _inVehicle) && (vehicle player == player) ) then
			{
				_inVehicle removeEventHandler ["Fired", _EH_Fired_Vehicle];
				_inVehicleLast = _inVehicle;
				_inVehicleLast removeEventHandler ["Fired", _EH_Fired_Vehicle];
				_inVehicle = objNull;
			};
			
			if ( vehicle player != player && isNull _inVehicle ) then
			{
				if (AGN_safeZoneMessages) then { systemChat ( "No Firing Vehicle Guns Enabled" ); };
				_inVehicle = vehicle player;
				_inVehicleDamage = getDammage _inVehicle;
				_EH_Fired_Vehicle = _inVehicle addEventHandler ["Fired", {
					systemChat ("You can not fire your vehicles weapon in a Trader City Area");
					NearestObject [_this select 0,_this select 4] setPos[0,0,0];
				}];
			};
		};
	} else {
		waitUntil { canBuild };
	};

	AGN_LastPlayerLookedAt = objNull;
	AGN_LastPlayerLookedAtCountDown = 5;
	terminate _antiBackpackThread;
	terminate _antiBackpackThread2;
	if ( AGN_safeZoneMessages ) then { systemChat ("Exiting Trader Area - God Mode Disabled"); };
	
	if ( AGN_safeZone_Vehicles_DisableMountedGuns ) then
	{
		if ( !(isNull _inVehicle) ) then
		{
			if ( AGN_safeZoneMessages ) then { systemChat ( "No Firing Vehicle Guns Disabled" ); };
			_inVehicle removeEventHandler ["Fired", _EH_Fired_Vehicle];
		};
		
		if ( !(isNull _inVehicleLast) ) then
		{
			if ( AGN_safeZoneMessages ) then { systemChat ( "No Firing Vehicle Guns Disabled" ); };
			_inVehicleLast removeEventHandler ["Fired", _EH_Fired_Vehicle];
		};
	};

	if ( AGN_safeZone_Players_DisableWeaponFiring ) then
	{
		_thePlayer removeEventHandler ["Fired", _EH_Fired];
	};
	
	if ( AGN_safeZoneGodmode ) then
	{
		player_zombieCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_zombieCheck.sqf";
		fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf";
		_thePlayer addEventHandler ["handleDamage", {true}];
		_thePlayer removeAllEventHandlers "handleDamage";
		_thePlayer allowDamage true;
		_inVehicle allowDamage true;
		player allowDamage true;
		(vehicle player) allowDamage true;
		{_x allowDamage true} forEach (nearestObjects [player,["LandVehicle","Air"], 50]);
	};
	
	_inSafezoneFinished = true;
};

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Similar Content

    • By calinova22
      How would I go about adding custom vehicles to my server? I want to have an F35B with no weapons. I know how to remove the weapons, just cant find the file for the jet itself to edit.
    • By xDUKEx
      Sorry if this post is in the wrong area on the forum ... I'm not sure if there would a better place to ask this question.
      The Actual Script can be found here:
      I've added the script and it works perfectly, however, I can't get the signs to populate around the safe zones.  I believe I need to be adding in actual coordinates to the script but I am not sure of the placement.  Can I stick them all within the [   ]'s and use commas to separate them ... or do I need to create a separate entry for each new location?  
      Here is the bit of the script I am using:
       
    • By Cyrus
      I have placed a fuel pump in starry using a custom script. The fuel pump is there and accessible but i would like to know how i can make it work with out the need of having to place a generator or a running fuel ural. by default it acts the same way a placeable fuel pump works picked up in the world. 
      Here is the code that use to spawn the fuel pump. 
      _vehicle_344 = objNull; if (true) then { _this = createVehicle ["Land_A_FuelStation_Feed", [6325.166, 7715.0869, 0.15837258], [], 0, "CAN_COLLIDE"]; _vehicle_344 = _this; _this setDir -52.000465; _this setPos [6325.166, 7715.0869, 0.15837258]; }; Any help will be appreciated.
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...