Voltan Posted May 31, 2018 Report Share Posted May 31, 2018 Hi all, I am running a Tavi server and I wish to prevent zombies spawning anywhere on Salvation Island (Sector B), does anyone have a script for this? I was thinking something along the lines of I put in a worldspace coord for the middle of Sec B and a radius from there that zombies dont spawn in Thanks Link to comment Share on other sites More sharing options...
0 Relentless Posted June 1, 2018 Report Share Posted June 1, 2018 It's late in the night, I am tired but here you go, you could give that a try: _pos = [yourposition]; _radius = 12345; while {1337 == 1337} do { _zombies = _pos nearEntities ["zZombie_Base", _radius]; { _x setDamage 1; hideObject _x; sleep 0.5; deleteVehicle _x; } forEach _zombies; }; Edit: The formatting of the code is trash, but I can't fix it. I am on the phone, sorry Schalldampfer 1 Link to comment Share on other sites More sharing options...
0 Schalldampfer Posted June 1, 2018 Report Share Posted June 1, 2018 function zombie_generate looks like spawning zombies zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf"; //Server compile, used for loiter behaviours so, disabling this function in the zone would also solve it please try this function below like a safezone script: Spoiler private ["_pos","_radius","_zg"]; _pos = [(center position of the island)]; _radius = (radius of the island); _zg = zombie_generate; //backup while (true) do { if((player distance _pos) < _radius) then {//check in the area zombie_generate = {false}; //disable spawning zombies } else { //when out of island zombie_generate = _zg; //enable spawning zombies }; sleep 5; //wait a bit to decrease cost }; (btw, why does it check 1337 is equals to 1337 everytime killing the zombies around?) Link to comment Share on other sites More sharing options...
0 Relentless Posted June 2, 2018 Report Share Posted June 2, 2018 @Schalldampfer You are trying to disable the zombie spawn completely. My code just deletes them. There are many ways to do it I guess. Voltan should try which solution works for him. It checks 1337 just because I can. You can do everything in the statement as long as it's true. 1337 == 1337 is the same as true Schalldampfer 1 Link to comment Share on other sites More sharing options...
0 seelenapparat Posted June 2, 2018 Report Share Posted June 2, 2018 even easier would be something like this: take the player_spawnCheck.sqf to the missionfile and edit it. somewhere where it says: if (getNumber(_config >> "zombieChance") > 0) then { above add: if (player distance [youcoordsarray) < 1000) exitwith {}; 1000 is roughly the islandsize from the middle of it (radius). or do I have a mistake in my thinking there? Schalldampfer 1 Link to comment Share on other sites More sharing options...
0 Voltan Posted June 3, 2018 Author Report Share Posted June 3, 2018 On 6/2/2018 at 8:48 AM, DAmNRelentless said: It's late in the night, I am tired but here you go, you could give that a try: _pos = [yourposition]; _radius = 12345; while {1337 == 1337} do { _zombies = _pos nearEntities ["zZombie_Base", _radius]; { _x setDamage 1; hideObject _x; sleep 0.5; deleteVehicle _x; } forEach _zombies; }; Edit: The formatting of the code is trash, but I can't fix it. I am on the phone, sorry is this called server side or client side, and where? Link to comment Share on other sites More sharing options...
0 Schalldampfer Posted June 3, 2018 Report Share Posted June 3, 2018 56 minutes ago, Voltan said: is this called server side or client side, and where? all those scripts are client side. use it like safe zone scripts Link to comment Share on other sites More sharing options...
0 Voltan Posted June 5, 2018 Author Report Share Posted June 5, 2018 On 6/2/2018 at 6:21 PM, seelenapparat said: even easier would be something like this: take the player_spawnCheck.sqf to the missionfile and edit it. somewhere where it says: if (getNumber(_config >> "zombieChance") > 0) then { above add: if (player distance [youcoordsarray) < 1000) exitwith {}; 1000 is roughly the islandsize from the middle of it (radius). or do I have a mistake in my thinking there? So, like this? if (player distance [22594,19635,0.001] < 1000) exitwith {}; Link to comment Share on other sites More sharing options...
0 seelenapparat Posted June 5, 2018 Report Share Posted June 5, 2018 yes. Voltan 1 Link to comment Share on other sites More sharing options...
0 Voltan Posted June 6, 2018 Author Report Share Posted June 6, 2018 On 6/5/2018 at 3:53 PM, Voltan said: So, like this? if (player distance [22594,19635,0.001] < 1000) exitwith {}; This worked like a charm. Thanks @seelenapparat seelenapparat and Schalldampfer 2 Link to comment Share on other sites More sharing options...
0 don2k7 Posted July 11, 2019 Report Share Posted July 11, 2019 On 6/6/2018 at 1:25 PM, Voltan said: This worked like a charm. Thanks @seelenapparat Thanks @seelenapparat and @Voltan . can confirm this works like a charm using epoch 1.0.6.2 and origins 1.8.3. Incase anyone is looking for this solution this is what i did. make a copy of the player_spawnCheck.sqf which is located; \z\addons\dayz_code\compile\player_spawnCheck.sqf and move copy to your mission file, I put mine here. missionfilename\dayz_code\compile\player_spawnCheck.sqf as mentioned above by @seelenapparat edit player_spawnCheck.sqf where it says: if (getNumber(_config >> "zombieChance") > 0) then { above add: if (player distance [youcoordsarray) < 1000) exitwith {}; then in your custom compiles assuming you have one add this; player_spawnCheck = compile preprocessFileLineNumbers "dayz_code\compile\player_spawnCheck.sqf"; below this; if (!isDedicated) then { diag_log "Loading custom client compiles"; Link to comment Share on other sites More sharing options...
Question
Voltan
Hi all,
I am running a Tavi server and I wish to prevent zombies spawning anywhere on Salvation Island (Sector B), does anyone have a script for this?
I was thinking something along the lines of I put in a worldspace coord for the middle of Sec B and a radius from there that zombies dont spawn in
Thanks
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now