Prevent Zed + loot spawn in safezones

thanks BaroN for the idea
This commit is contained in:
icomrade
2017-09-13 12:45:00 -04:00
parent 404210ac04
commit d750f576ed
10 changed files with 61 additions and 56 deletions

View File

@@ -33,12 +33,13 @@ if (_canLoot ) then {
//Walking Zombies
_num = (round(random _max)) max _min; // + round(_max / 3);
//diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num));
for "_i" from 0 to _num do
{
//_iPos = _obj modelToWorld _originalPos;
if ((_maxlocalspawned < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then {
[_originalPos,true,_unitTypes,_wreck] call zombie_generate;
if(!(_originalPos call DZE_SafeZonePosCheck)) then {
for "_i" from 0 to _num do
{
//_iPos = _obj modelToWorld _originalPos;
if ((_maxlocalspawned < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then {
[_originalPos,true,_unitTypes,_wreck] call zombie_generate;
};
};
};
@@ -51,7 +52,7 @@ if (_canLoot ) then {
{
_Pos = [_x select 0, _x select 1, 0];
_rnd = random 1;
if (_rnd < _zombieChance) then {
if (_rnd < _zombieChance && {!(_Pos call DZE_SafeZonePosCheck)}) then {
_iPos = _obj modelToWorld _Pos;
_nearByZed = {alive _x} count (_iPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]) > 0;
_nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0;