Jump to content
  • 0

Anti-zombie shield for safezones


Storm

Question

I am trying to get a anti-zombie shield to work for my trader cities.

Right now I am using a made one by Sarge that is supposed to trigger for coords, in which to stop and kill the zombies from spawning, but for some reason it does not want to work.

private["_location","_radius","_nuker","_obj_text_string"];
 
    if(!isServer) exitwith{};
 
    _location = _this select 0;
    _radius = _this select 1;
 
    _nuker = createvehicle ["Sign_sphere25cm_EP1",[_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;
        };
    };

I am using nuker to get kill the zombies, not sure if I did it correct.

 

I am trigging it from the init.sqf file which is like this

[[6325.6772,304.99033,7807.7412],400] execVM "AGN\NoZeds.sqf";

 

But the zombies still spawn in that area.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0
ZED_safeZone_DisableZombies = true;
if ( ZED_safeZone_DisableZombies ) then
{
no_zombies_loop = true;
_pos = getPos (vehicle player);
_zombies = _pos nearEntities ["zZombie_Base",100];
{deletevehicle _x;} forEach _zombies;
sleep 1;
};

Edited the code to make it work for my safezone, you can do the same.

Link to comment
Share on other sites

  • 0

the best way i think is to call the script from the mision.sqf where your trade cities are set, as i remember it is a next after the markers class do not remember its names. I used such script to delete zeds from the tradezones when a player enters it. This causes less lags then loop check

Link to comment
Share on other sites

  • 0

The script I posted in my second post.

It runs off my safezone script, which soon as a player enters the safezone it will delete the zombies that get near it.

I will probably end up releasing my safezone script at a latter time.

Currently it has a working anti-theft and some other really good things in it.

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
  • Advertisement
  • Discord

×
×
  • Create New...