[RELEASE] AI delete in Safe Zones

HisShadowONE

Well-Known Member
Big thanks to lunchbox , inkko, fallingsheep,swede, and many others any i may have forgot for all the input and help trying to get this to work , seems it finally does! so heres the release


make a file called SafeZoneAI.sqf and paste the following into it
Code:
// Despawn AI around safezones (Lunchbox).
if (isNil 'no_ai_loop') then {no_ai_loop = true;};
while {true} do {
waitUntil { !canbuild };
_pos = getPos (vehicle player);
_nearunits = _pos nearEntities ["Man",50];
_unitskilled=[];
{
if ((_x in allunits) and !(_x in Agents) and !(_x in playableunits))then{
deletevehicle _x;
};
} forEach _nearunits;
sleep 1;
};

then open your init.sqf and add the following at the end of under the isdedicated section wherever you link to your scripts. add the link to the new file.
Code:
    // Safe Zones for AI
    [] execVM "scripts\SafeZonesAI.sqf";

and there you have it any ai that target or fire at you within 50m of the safezones are automatically deleted. enjoy.
 
Back
Top