Sign in to follow this  
[CSG]SMOKE

FIX For Zeds In Safe Zones!!

6 posts in this topic

this is my fnc_Zcontact.sqf just copy mine to fix zeds spawning in the safe zones...this script works 98% of the time you will still get a random zed in the safe zone from time to time but this is a major help trust me...Give it a try and post some feed Thx Guys...you can see the chunk of code at the bottom that deletes the zeds... 

 

_suoni =  ["zomb1","zomb2","zomb3"];
_zombie = _this select 0;
_zombie disableAI "FSM";
_zombie disableAI "AUTOTARGET";
_zombie disableAI "TARGET";
_zombie setBehaviour "CARELESS";
_zombie disableConversation true;
_zombie addRating -10000;
zarray = zarray + [_zombie];

if (zombierun < 1) then {_zombie setdamage 0.5;};

while {alive _zombie} do {
    _unitsaround = _zombie nearEntities ["Man", 500];
    _targets = [];
    
    {
        if (group _x != groupZMB && side _x != SideZMB) then
        {
            _targets = _targets +[_x];
        };
        sleep 0.01;
    }foreach _unitsaround;
    
    _ntargets = count _targets;
    
    if (_ntargets> 0) then 
    {
        _target = player;
        {
            if (_zombie distance position _x < _zombie distance position _target) then
            {
                _target = _x;
            };
            sleep 0.01;
        }foreach _targets;
    
        if (_zombie distance getposATL _target < 160) then {_zombie doMove getposATL _target;};
        if (_zombie distance getposATL _target < 1.5 && alive _target  && _target != _zombie) then 
        {
            _zombie switchMove "AwopPercMstpSgthWnonDnon_end";
            _target setDamage (damage _target + (zombiedamage/100));
            _zombie say3d "zomb2";
            sleep 1.5;
        };
    };
    if (!isDedicated) then
    {
        if (player distance position _zombie > 400) then
        {
            zarray = zarray - [_zombie];
            deletevehicle _zombie;
        };
    }
    else
    {
        if (player distance position _zombie > 400) then
        {
            zarray = zarray - [_zombie];
            deletevehicle _zombie;
        };
    };
    sleep 0.5;
    
    {
        _markerName = _x;
        if (getMarkerType _markerName == "ExileTraderZone") then
        {
            if ((getMarkerPos _markerName) distance2D (getPos player) < ((getMarkerSize _markerName) select 0)) then
            {
            
                {
                    _zombie = _x;
                    if(!(isPlayer _zombie)) then 
                    {
                        if(isNil {_zombie getVariable "BIS_fnc_animalBehaviour_disable"}) then
                        {
                            _zombie setdamage 1;
                            deleteVehicle _zombie;
                        }
                    };
                } forEach (player nearEntities ['Man',100]);
            };
        };
    } forEach allMapMarkers;
};
//player addRating 2000;
_zombie setdamage 1;
sleep respawntime;
zarray = zarray - [_zombie];
deletevehicle _zombie;

  • Like 1

Share this post


Link to post
Share on other sites
Advertisement
Advertisement

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.