Jump to content
  • 0
CartoonrBOY

Dogs being deleted

Question

Hey. I am using this script to have a loyal dog and it works great but I have had to delete the animal cleanup to have it work. This is not ideal. Does anyone know how to disable animal cleanup just for the spawned dogs?

 

Dog mod

 

This is the code which needs editing rather than switching off:

server_spawnCleanAnimals = {
	private ["_pos","_delQtyAnimal","_qty","_missonAnimals","_nearby"];
	_missonAnimals = entities "CAAnimalBase";
	_delQtyAnimal = 0;
	{
		if (local _x) then {
			_x call dayz_perform_purge;
			sleep 0.05;
			_delQtyAnimal = _delQtyAnimal + 1;
		} else {
			if (!alive _x) then {
				_pos = getPosATL _x;
				if (count _pos > 0) then {
					_nearby = {(isPlayer _x) && (alive _x)} count (_pos nearEntities [["CAManBase","AllVehicles"], 130]);
					if (_nearby==0) then {
						_x call dayz_perform_purge;
						sleep 0.05;
						_delQtyAnimal = _delQtyAnimal + 1;
					};
				};
			};
		};
		sleep 0.001;
	} count _missonAnimals;
	if (_delQtyAnimal > 0) then {
		_qty = count _missonAnimals;
		diag_log (format["CLEANUP: Deleted %1 Animals out of %2",_delQtyAnimal,_qty]);
	};
};

Thanks in advance.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By MessiGamer
      Hello. I was trying for a dog to spawn with hero player. I searched a lot and found nothing on the internet for dayz epoch. i don't know much about scripting, so anyone can help me? I think this is not too complicated
      like you spawn on server and a trained dog appears or spawn in your plot pole.
    • By SryImAnooB
      Hey guys, i need some help/answers.
      I have no clue about cleanup the server from loot when no one is around for a specific amount of time.
      I noticed that this was uncommented in server_function.sqf:
      server_systemCleanup = compile preprocessFileLineNumbers "\z\addons\dayz_server\system\server_cleanup.sqf"; so i removed the // and checked what happend...nothing :D
      Then i checked out the server_cleanup.sqf.
      In line 23 it says:
      if (_age > 20) then { changed to:
      if (_age > 2) then { cause i thought 20 = 20min ?! so 2 = 2min. Was a try nothing happend.
      I googled around and noticed that in 1.0.5.1 the server_cleanup was .fsm and not .sqf. Does this matter?
      And does anyone have a tip how to cleanup loot when for ex. a player is not in range from 500m for 5 mins?!
    • By Birgitte
      Hi Guys,
      I have a working 1.0.6.1 server. When my guys or I place a fuel pump, fire barrel, generator, etc. the server deletes it after a week or so. Is there a setting I'm missing to stop this from happening?
       
      Thanks,
       
      Birgitte
    • By i3lackoutHD
      Hello!
      Anyone got the same problem? :
      I have hundreds of zombies around the map.
      Even if theres no player nearby.
    • By Kimzer
      Hi Guys!
       
      I forgot to backup my cleanup.sql when transferring to a new server.
      Soo, i was hoping someone would do me a solid and share some good cleanup to be ran each time the server reboots.
       
      Kimz!
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...