Sign in to follow this  
Followers 0
[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;

1 person likes this

Share this post


Link to post
Share on other sites

Working great!

If you can figure out how to add respect/tabs for killing them, that would be amazing!

Share this post


Link to post
Share on other sites
Advertisement

yes fine with me ...

Looks good! With your permission, I want to break down the code and try to implement it into COS.

yes i have no problem with that..

Share this post


Link to post
Share on other sites

what about deleting them on entering safezone?

 

and @Cen : Point/Reward would be great!

Share this post


Link to post
Share on other sites
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  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.