Jump to content
Sign in to follow this  
pcc

Error 0 elements provided, 3 expected

Recommended Posts

I'm trying to delete CraterLong objects from aircraft crashes in warfare using Common_UnitKilled.sqf.  It works, but it sometimes gives the following error.

Bad conversion: array
Error in expression <ep 6; {deleteVehicle _x} foreach (_this nearObjects ["CraterLong",25])};
};
Error position: <nearObjects ["CraterLong",25])};
};
Error 0 elements provided, 3 expected

 

}
//Client bodies or client/server vehicles.
else
{
	if(([Vehicle _victim] Select 0) isKindOf "Air")then
	{
		[Vehicle _victim] Select 0 spawn {sleep 6; {deleteVehicle _x} foreach (_this nearObjects ["CraterLong",25])};
	};
	[_victim] Select 0 spawn {sleep 12; deleteVehicle _this};
};

 

Share this post


Link to post
Share on other sites

Everyone has their own and opinion of masterpiece at some point.

With or without Vehicle and select 0 it didn't cause the error, its not the main problem here.

 

What's wrong with the syntax? 

position nearObjects [typeName, radius]

https://community.bistudio.com/wiki/nearObjects

 

I'll test with nearestObjects.

Edit: same error

Bad conversion: array
Error in expression <n {sleep 6; {deleteVehicle _x} foreach (nearestObjects [_this, ["CraterLong"], 5>
  Error position: <nearestObjects [_this, ["CraterLong"], 5>
  Error 0 elements provided, 3 expected

 

//Client bodies or client/server vehicles.
else
{

	if(([_victim] Select 0) isKindOf "Air")then
	{
		[_victim] Select 0 spawn {sleep 6; {deleteVehicle _x} foreach (nearestObjects [_this, ["CraterLong"], 50])};
	};
	[_victim] Select 0 spawn {sleep 12; deleteVehicle _this};
};

Edit: Fixed with getPos using nearObjects.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×