Jump to content
  • 0

Bury Corpses Cleanup Script | Working but with error in RPT-Log


DeliciousAce

Question

Hello Epoch Community,

I am looking to for a solution for our cleanup script.
This clean up delete the tombs from the bury corpses script ---> seaweeduk Bury Corpses
Since my post was deleted from the Forum openayz for reasons that I can not understand.....

We used this clean up:

 

diag_log ("Custom CleanUp Script Loaded");
if (isServer) then {
	[] spawn {
	 diag_log format ["Cleanup2 INIT at %1", time];
		while {true} do {
			sleep 200;
			_objects1 = (allMissionObjects "ReammoBox");
			_objects2 = (allMissionObjects "Sound_Flies");
			_objects3 = (allMissionObjects "Land_Fire_DZ");
			_objectsX = _objects1 + _objects2 + _objects3 + alldead;
			
			_tmpObjects = [];
			{
				_nearby = {isPlayer _x} count (_x nearEntities [["CAManBase"], 500]);
				_keep = _x getVariable ["permaLoot",false];
				if ((_nearby == 0) && (!_keep) && !(_x in alldead)) then 
				{
					_tmpObjects = _tmpObjects + [_x];
				};
				_nearby = {isPlayer _x} count (_x nearEntities [["CAManBase"], 250]);
				if ((_nearby == 0) && (_x in alldead) && (_x isKindOf "zZombie_Base")) then 
				{
				    diag_log format ["CLEANUP2: Deleting %1", _x];
					deleteVehicle _x;
				};
			} foreach _objectsX;
			sleep 100;
			
			{
				_nearby = {isPlayer _x} count (_x nearEntities [["CAManBase"], 500]);
				_keep = _x getVariable ["permaLoot",false];
				if ((_nearby == 0) && (!_keep) && !(_x in alldead)) then 
				{
				    diag_log format ["CLEANUP2: Deleting %1", _x];
					deleteVehicle _x;
				};
			} forEach _tmpObjects;
		};
	};
};

And adapted it Like this:

 

diag_log ("Custom CleanUp Script Loaded");
if (isServer) then {
	[] spawn {
	 diag_log format ["Cleanup2 INIT at %1", time];
		while {true} do {
			sleep 120;
//			_objects1 = (allMissionObjects "ReammoBox");
			_objects2 = (allMissionObjects "Sound_Flies");
			_objects3 = (allMissionObjects "Land_Fire_DZ");
			_objects4 = (allMissionObjects "Grave");
			_objects5 = (allMissionObjects "GraveCross1");
			_objects6 = (allMissionObjects "GraveCross2");
			_objects7 = (allMissionObjects "GraveCrossHelmet");
			_objectsX = _objects2 + _objects3 + _objects4 + _objects5 + _objects6 + _objects7 + alldead;
			
			
			_ammobox = ["USBasicAmmunitionBox"];
			
			_tmpObjects = [];
			{
				_nearby = {isPlayer _x} count (_x nearEntities [["CAManBase"], 1]);
				_keep = _x getVariable ["permaLoot",false] and (typeOf _x in _ammobox);
				if ((_nearby == 0) && (!_keep) && !(_x in alldead)) then 
				{
					_tmpObjects = _tmpObjects + [_x];
				};
				_nearby = {isPlayer _x} count (_x nearEntities [["CAManBase"], 250]);
				if ((_nearby == 0) && (_x in alldead) && (_x isKindOf "zZombie_Base")) then 
				{
				    diag_log format ["CLEANUP2: Deleting %1", _x];
					deleteVehicle _x;
				};
			} foreach _objectsX;
			sleep 60;
			
			{
				_nearby = {isPlayer _x} count (_x nearEntities [["CAManBase"], 1]);
				_keep = _x getVariable ["permaLoot",false];
				if ((_nearby == 0) && (!_keep) && !(_x in alldead)) then 
				{
				    diag_log format ["CLEANUP3: Deleting %1", _x];
					deleteVehicle _x;
				};
			} forEach _tmpObjects;
		};
	};
};

The Clean up is Working and deletes the Graves and Crosses:
 

21:09:11 "CLEANUP3: Deleting 33ebc100# 1056290: hrobecek.p3d"
21:09:11 "CLEANUP3: Deleting 33ebcf00# 1056288: hrobecek_krizekhelma.p3d"
21:09:11 "CLEANUP3: Deleting 33ebd600# 1056287: hrobecek_krizek1.p3d"
21:09:11 "CLEANUP3: Deleting 33ebdd00# 1056286: mrtvola_army1.p3d"
21:09:11 "CLEANUP3: Deleting 33ebeb00# 1056284: mrtvola_army1.p3d"
21:09:11 "CLEANUP3: Deleting 33ebe400# 1056285: mrtvola_army1.p3d"
21:09:11 "CLEANUP3: Deleting 33ebc800# 1056289: hrobecek_krizek2.p3d"
21:09:11 "CLEANUP3: Deleting 33eaf900# 1056291: hrobecek.p3d"
21:09:11 "CLEANUP3: Deleting 3276ab00# 1056107: mrtvola_army1.p3d"
21:09:11 "CLEANUP3: Deleting 3276a400# 1056108: mrtvola_army1.p3d"
21:09:11 "CLEANUP3: Deleting 3276b200# 1056106: mrtvola_army1.p3d"
21:09:11 "CLEANUP3: Deleting 32772b00# 1056101: mrtvola_army1.p3d"
21:09:11 "CLEANUP3: Deleting 32769d00# 1056109: mrtvola_army1.p3d"

But the RPT-Log spit out an Error Message:
 

21:09:51 File z\addons\dayz_server\compile\cleanup.sqf, line 40
21:09:51 Bad conversion: array
21:09:51 Error in expression <0;

{
_nearby = {isPlayer _x} count (_x nearEntities [["CAManBase"], 1]);
_keep >
21:09:51   Error position: <nearEntities [["CAManBase"], 1]);
_keep >
21:09:51   Error 0 elements provided, 3 expected

We are not very skilled in scripting but we try to learn and grab up everything Important.
Maybe some one you outhere can help us with this one :)

Thanks in Advance!!


Ace

 

Link to comment
Share on other sites

3 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
  • Advertisement
  • Discord

×
×
  • Create New...