In Search of Anti-Zombie, and Car God Mode at Trader Zones.. using AGN

DangerRuss

OpenDayZ Rockstar!
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.
 
Those are the 2 issues I'm having as well. I tried adding god mode to vehicles in the area but it didn't seem to work. Tried a zed shield as well and nothing happened with that as well.
 
I've got two working zed shields you can choose from. One is just a script you call in the init.sqf the other uses sensors in the mission.sqm.
As for god mode I just went with an add-on that makes locked vehicles indestructible. When I get home from work I'll put them up.
 
I was looking at that locked vehicle one as well, but i'd just want it for safezones. Maybe I can modify it to work only in safezones.
 
I was looking at that locked vehicle one as well, but i'd just want it for safezones. Maybe I can modify it to work only in safezones.
That would be interesting.
Ok the first zed shield is an oldy from Sarge back in the day. But it works.
Now with this script Im giving you it has been modified to use the "empty heli pad" so that there is no visual clue where the zone actually is. You could change this and make it into any sign from arma. Originally it was just a small floating pink orb, looked kinda odd. Also, you could modify this script to, instead of killing zombies, delete them. As it is now, the zombies will just die and their bodies will remain.
Script.
Code:
/*
    Author: Sarge
    Description:
    Kills all zombies in a given distance from a given point.
    Needs 2 parameters:
    _location = the exact x/y/z location of the center of the area that should be zed free
    _range = the radius within which zeds get killed
*/
    private["_location","_radius","_nuker","_obj_text_string"];
    if(!isServer) exitwith{};
    _location = _this select 0;
    _radius = _this select 1;
    _nuker = createvehicle ["HeliHEmpty",[_location select 0,_location select 1,1] ,[],0,"NONE"];
    _nuker allowDamage false;
    _obj_text_string = format["#(argb,8,8,3)color(%1,%2,%3,%4,ca)",1,1,0,1];
    [nil,nil,rSETOBJECTTEXTURE,_nuker,0,_obj_text_string] call RE;
    [_nuker,_radius] spawn {
        private ["_nuker","_radius","_entity_array"];
        _nuker = _this select 0;
        _radius = _this select 1;
  
        while {true} do {
  
            _entity_array = (getPos _nuker) nearEntities ["CAManBase",_radius];
            {
                if (_x isKindof "zZombie_Base") then {
                    _x setDamage 1;
                };
            } forEach _entity_array;
            sleep 2;
        };
    };

Init.sqf
Code:
[[2193.6208,12774.56,0.001],300] execVM "custom\ZedNuker.sqf";
The first bracket are the coords, the 300 is the radius.
I use this particular code on vanilla dayz. On Epoch I use this one
Script
Code:
if (isNil "zombiefree") then {
    zombiefree = false;
};

while {zombiefree} do {
            _entity_array = (getPos player) nearEntities ["CAManBase",110];
            {
                if (_x isKindof "zZombie_Base") then {
                    deletevehicle _x;
                };
            } forEach _entity_array;
            sleep 4;
        };

and then make a sensor in the mission.sqm
Code:
class Item11
        {
            position[]={12944.227,210.19823,12766.889};
            a=110;
            b=110;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="zombiefreearea4";
            expCond="(player distance zombiefreearea4) < 110;";
            expActiv="zombiefree = true; zombiefreezone = [] execVM ""custom\ZedNukers\ZedNukerz.sqf"";";
            expDesactiv="terminate zombiefreezone; titleText [""\n\nLeaving zombie free zone."", ""PLAIN DOWN"", 3];";
            class Effects
            {
            titleType="TEXT";
            titleEffect="PLAIN DOWN";
            title="Entering zombie free zone.";
            };
        };
make sure you change the class item number to match your sensor section, and make sure at the top of the sensor section you change the number to match the total number of sensors in that section.
 
I'm thinking for the vehicle god mode, just adding a check for canbuild, just haven't looked at the script yet so I have no idea if I'll be able to add it in easily.

I'll test out the deleting zombies one, since that'll look kinda weird having a ring of dead zeds around trader cities. Probably will use the same sensors that are already in just add the extra stuff for zed shield. Gonna be taking a look at the god mode vehicles and if I get it working I'll let ya know.

Hoping something like this will work:
Code:
class Item0
        {
            position[]={6325.6772,304.99033,7807.7412};
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="zonestary";
            expCond="(player distance zonestary) < 100;";
            expActiv="zombiefree = true; zombiefreezone = [] execVM ""custom\ZedNukers\ZedNukerz.sqf"";TitleText[""Now entering trader city Stary. \n Vehicles left in trader cities will be deleted after 24 hours."",""PLAIN DOWN""]; canbuild = false;";
            expDesactiv="terminate zombiefreezone;TitleText[""Now leaving trader city Stary"",""PLAIN DOWN""]; canbuild = true;";
            class Effects
            {
            };
        };
 
Last edited:
Actually went ahead an I think I've integrated the zombie shield you posted above into the AGN safezones

Code:
...  
private ["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",
        "AGN_safeZone_Players_RemoveZombies","AGN_safeZone_VehicleGod"];


//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 = true;        //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?
AGN_safeZone_VehicleGod= false;                            //Should players remove vehicle damage handlers nearby while in safezones??

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

waitUntil {!isNil "dayz_animalCheck"};
if ( AGN_safeZoneMessages ) then { systemChat ( "[AGN] Trader Zone Commander Loaded!" ); };

_inVehicle = objNull;
_inVehicleLast = objNull;

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

    _inSafezoneFinished = false;
    if ( AGN_safeZoneMessages ) then { systemChat ("[AGN] 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;
        _zombies = _basis nearEntities ["zZombie_Base",50];
        _count = count _zombies;
        for "_i" from 0 to (_count -1) do
        { 
            _zombie = _zombies select _i;
            deletevehicle _zombie;
        };
       
    };
   
    if ( AGN_safeZone_Players_DisableWeaponFiring ) then
    {
        _EH_Fired = _thePlayer addEventHandler ["Fired", {
            systemChat ("[AGN] 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_Players_RemoveZombies ) then
    {
        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_VehicleGod ) then
    {
        // WIP
    };
  ...
 
Weill i kinda just spat this out, no idea if it'll work but something along the lines of this should be functional with some tweaks.
Pretty much trying to get it to find vehicles within a radius, add them to an array then god mode each one in the array, then removing all godmodes once out of safezones. Pretty sure it needs some tweaking still to get it actually functioning since now that I've typed this up i noticed some things that would make it not function correctly.

Code:
// not functional at the moment, WIP
if ( AGN_safeZone_VehicleGod ) then
    {  
        _y = 0;
        while {!canbuild} do {
            _veh_array = (getPos player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],110];
            while {(_y < (count _veh_array)) and (!canbuild)} do {
                _vehicle = (_veh_array select _y);
                _veh_total = _veh_total + _vehicle;
                _y = _y + 1;
                while {!canbuild} do {                                     // loop for canbuild check
                    {  
                        _x allowDamage false;
                        _x enableSimulation false;      
                    } forEach _veh_total;
                } else {
                    {
                        _x allowDamage true;
                        _x enableSimulation true;  
                    } forEach _veh_total;
                };
            };
        };
    };
 
you can always change that Sarge script to use the same
Code:
deletevehicle _x
that the other version I provided uses instead of
Code:
_x setDamage 1
but yea I really wanted it in the AGN or at least similar which is why I went with the mission.sqm version. Can you confirm that AGN script working with your upgrade?
 
thanks for taking up the helm on this. will be really cool if you can get this to work.
It all still needs to be tested but theoretically the zombie part integrated into it should work from my understanding. The god mode is like the zombie script but it compiles a list of the vehicles and hopefully god modes them all then ungod modes them on exiting. But I'll test them both later tonight and let ya know.
 
Well actually SAR remove zeds works absolutely perfect tho. It's just this part:

Code:
(_x isKindof

being blocked because of the BattleEye Filters :) Simply search for that line in the filters and change 5 to 1.
 
yea they both work. I was looking for a way to incorporate the zombie script into the AGN though, so it was one clean install instead of multiple scripts. I use the Sarge one on regular dayz.
 
Yea I'll throw the AGN that you posted on tonight and see if it works. If so that will be cool
I tested the code block for zombies I added to the AGN safe zones and it works, only issue is that the bubble is created around a player so if they are at the edge of a safe zone zombies 100m away outside of the safe zone are deleted as well.
 
Well actually SAR remove zeds works absolutely perfect tho. It's just this part:

Code:
(_x isKindof

being blocked because of the BattleEye Filters :) Simply search for that line in the filters and change 5 to 1.
Oh I just thought about that SARGE script and the reason I don't use it on epoch. So some of the ai spawn the vehicles above their heads and stuff like that
 
Maybe theres a way to pull the sensors pos instead of using the player, might look into that for the zed shield. Haven't worked on the god mode at all for vehicles tho.
 
Maybe theres a way to pull the sensors pos instead of using the player, might look into that for the zed shield. Haven't worked on the god mode at all for vehicles tho.
I tried that AGN updated with the zombie shield you posted earlier and it broke the safezones. Bummer
 
Oh I see, the original post wasn't the complete AGN, I wasn't even looking I just pasted it in. Thanks. Works well, but yea there is that very minor bug with players setting the range instead of the cords for the marker. Not really a big deal and doesn't bother me one bit.
I award you one can of beans and a beer.

If you get this working with vehicle god mode, repost this in the release section and on epochmod.com... obviously credit the original author but he's moved on from ARMA and gave permission for anyone to update the script. This would be better and easier than the "better safezones" mod in my opinion.
 
Back
Top