pcc 14 Posted May 6, 2017 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
killzone_kid 1326 Posted May 6, 2017 Oh nice! I have seen a lot of bad code, but this will definitely top my list!!! 14 hours ago, pcc said: [Vehicle _victim] Select 0 What a masterpiece! And yeah, just like error says nearObjects ["CraterLong",25] wrong syntax: https://community.bistudio.com/wiki/nearestObjects Share this post Link to post Share on other sites
pcc 14 Posted May 7, 2017 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