Zed free plots not working


OpenDayZ Rockstar!
Source: http://epochmod.com/forum/index.php?/topic/616-zombie-free-bases/

So what I want is to kill zombies that run within 60 meters from a plot pole.

I execute the script from the 'isDedicated' loop in the init.sqf.

This is the code I used.

// 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",60];
    _count2 = count _zombies2;
for "_i" from 0 to (_count2 -1) do
    _zombie2 = _zombies2 select _i;
    _zombie2 setdamage 1;
I must be missing something since it doesn't work, any help is appreciated.


OpenDayZ Guru!
perhaps I am wrong but you are running that in the isdedicated loop ... but zombies are on clients only so you should run it in !isserver loop ?


Well-Known Member
Also small issue in most cases, but there is no garuntee those zombies are on your client. For your kill Zed routine, you should make a client/server pair that passed the command to whichever machine the zed is local on.


OpenDayZ Guru!
but that script is run in the mission of ALL clients. so it deletes locally all zombies. Or possibly the nearentities returns all entities regardless of the owner .. not sure about that, but the script works as it is


Well-Known Member
Yeh, if it is running on all clients it would.

I would prefer to write it so it only deletes them from the owners pc so there is a little hostility for visitors in which case you would need that.