Jump to content
  • 0

Zombie Shield around Plotpole


TylerHumor

Question

10 answers to this question

Recommended Posts

  • 0

Create a file called safearea.sqf and put this in it : 

while {true} do {
  sleep 10;


  // No Zeds near Plot Poles
  _playerPos = getPos player;
  _nearPole = nearestObject [_playerPos, "Plastic_Pole_EP1_DZ"];
  if (!isNull _nearPole) then {
    _pos2 = getPos _nearPole;
    _zombies2 = _pos2 nearEntities ["zZombie_Base", dayz_poleSafeArea];
    _count2 = count _zombies2;
    for "_i" from 0 to (_count2 -1) do
    {
      _zombie2 = _zombies2 select _i;
      _zombie2 setpos [-3367.739,-120.84577,-8247.0625];
    };
  };
};

Then call it in the init.sqf like this : 

//Anti Zombie Bases
execVM "whereveryouputyourfile\safearea.sqf";

Link to comment
Share on other sites

  • 0

 

Create a file called safearea.sqf and put this in it : 

while {true} do {
  sleep 10;


  // No Zeds near Plot Poles
  _playerPos = getPos player;
  _nearPole = nearestObject [_playerPos, "Plastic_Pole_EP1_DZ"];
  if (!isNull _nearPole) then {
    _pos2 = getPos _nearPole;
    _zombies2 = _pos2 nearEntities ["zZombie_Base", dayz_poleSafeArea];
    _count2 = count _zombies2;
    for "_i" from 0 to (_count2 -1) do
    {
      _zombie2 = _zombies2 select _i;
      _zombie2 setpos [-3367.739,-120.84577,-8247.0625];
    };
  };
};

Then call it in the init.sqf like this : 

//Anti Zombie Bases
execVM "whereveryouputyourfile\safearea.sqf";

Thank you sir! I'll go test this! :D

Link to comment
Share on other sites

  • 0

while {true} do {
sleep 10;


// No Zeds near Plot Poles
_playerPos
= getPos player;
_nearPole = nearestObject [_playerPos, "Plastic_Pole_EP1_DZ"]; <--- this is the error

 

must be:

 

// No Zeds near Plot Poles
_playerPos = getPos player;
_nearPole = nearestObjects [_playerPos, "Plastic_Pole_EP1_DZ", 30]; //Change the 30 to the radius you want

 

if ((count _nearPole) > 1) then {
_pos2 = getPos (_nearPole select 0);
_zombies2 = _pos2 nearEntities ["zZombie_Base", dayz_poleSafeArea];
_count2 = count _zombies2;
for "_i" from 0 to (_count2 -1) do
{
_zombie2 = _zombies2 select _i;
deleteVehicle _zombie2; // makes it more performant I guess
};
};
};

Link to comment
Share on other sites

  • 0

while {true} do {

sleep 10;

// No Zeds near Plot Poles

_playerPos = getPos player;

_nearPole = nearestObject [_playerPos, "Plastic_Pole_EP1_DZ"]; <--- this is the error

 

must be:

 

// No Zeds near Plot Poles

_playerPos = getPos player;

_nearPole = nearestObjects [_playerPos, "Plastic_Pole_EP1_DZ", 30]; //Change the 30 to the radius you want

 

if ((count _nearPole) > 1) then {

_pos2 = getPos (_nearPole select 0);

_zombies2 = _pos2 nearEntities ["zZombie_Base", dayz_poleSafeArea];

_count2 = count _zombies2;

for "_i" from 0 to (_count2 -1) do

{

_zombie2 = _zombies2 select _i;

deleteVehicle _zombie2; // makes it more performant I guess

};

};

};

Thank you, to both of you. I'll try it out! :D

Link to comment
Share on other sites

  • 0

while {true} do {

sleep 10;

// No Zeds near Plot Poles

_playerPos = getPos player;

_nearPole = nearestObject [_playerPos, "Plastic_Pole_EP1_DZ"]; <--- this is the error

 

must be:

 

// No Zeds near Plot Poles

_playerPos = getPos player;

_nearPole = nearestObjects [_playerPos, "Plastic_Pole_EP1_DZ", 30]; //Change the 30 to the radius you want

 

if ((count _nearPole) > 1) then {

_pos2 = getPos (_nearPole select 0);

_zombies2 = _pos2 nearEntities ["zZombie_Base", dayz_poleSafeArea];

_count2 = count _zombies2;

for "_i" from 0 to (_count2 -1) do

{

_zombie2 = _zombies2 select _i;

deleteVehicle _zombie2; // makes it more performant I guess

};

};

};

I tested this by spawning zombies outside the plot pole radius and shooting gun within the 30meter plot pole radius. The zombies were able to run/attack with in the radius and were not affected.

Link to comment
Share on other sites

  • 0

That script I posted has been working fine on both my servers since the day I installed it with no errors anywhere.

 

[EDIT : Ahhh ... Just realised I use this script in conjunction with  : 

dayz_poleSafeArea = 30;

in my init.sqf.

 

My apologies. If you use the init.sqf edit AND the script in the 2nd post, it will work perfectly.]

Link to comment
Share on other sites

  • 0

That script I posted has been working fine on both my servers since the day I installed it with no errors anywhere.

 

[EDIT : Ahhh ... Just realised I use this script in conjunction with  : 

dayz_poleSafeArea = 30;

in my init.sqf.

 

My apologies. If you use the init.sqf edit AND the script in the 2nd post, it will work perfectly.]

So, would I add "dayz_poleSafeArea = 30;" under "DayZ Epoch Config"?

Link to comment
Share on other sites

  • 0

I tested this by spawning zombies outside the plot pole radius and shooting gun within the 30meter plot pole radius. The zombies were able to run/attack with in the radius and were not affected.

 

just make the script more aggressive

 

change this:

sleep 10;

 

to something like

sleep 1;

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...