Jump to content
eviljack109

Deleting certain vehicles in an area script help.

Recommended Posts

_carCount = entities ["B_MRAP_01_hmg_F","B_MRAP_01_gmg_F"] select {_x inArea "trialAO_1"}; //finds all cars in area of trialAO_1

{
	deleteVehicle _x; //delete everything!
} forEach _carCount; //... Well, everything in this array atleast.

Need some help with this bit of code. Getting "missing ;" error with first line. First line should be making an array of all entities, of the 2 classnames, in the marker. The forEach is just deleting all those entities.

Share this post


Link to post
Share on other sites

check https://community.bistudio.com/wiki/entities for the syntax. Correct usage in this case:

_carCount = entities [["B_MRAP_01_hmg_F","B_MRAP_01_gmg_F"], []] select {_x inArea "trialAO_1"}; //finds all cars in area of trialAO_1

Also a bit of optimization could be done with using https://community.bistudio.com/wiki/inAreaArray instead of inArea.

  • Like 1

Share this post


Link to post
Share on other sites
13 minutes ago, 7erra said:

check https://community.bistudio.com/wiki/entities for the syntax. Correct usage in this case:


_carCount = entities [["B_MRAP_01_hmg_F","B_MRAP_01_gmg_F"], []] select {_x inArea "trialAO_1"}; //finds all cars in area of trialAO_1

Also a bit of optimization could be done with using https://community.bistudio.com/wiki/inAreaArray instead of inArea.

 

 

Your fix works! Thank you so much!

My attempt at using the inAreaArray:
 

_carCount = ["B_MRAP_01_hmg_F","B_MRAP_01_gmg_F"] inAreaArray [getMarkerPos "trialAO_1"]

{
	deleteVehicle _x; //delete everything!
} forEach _carCount; //... Well, everything in this array atleast.

Getting same "error missing;" msg but not on the last line. I think I am using it wrong and it's somehow storing the wrong thing in _carCount.

Share this post


Link to post
Share on other sites
_carCount = (entities [["B_MRAP_01_hmg_F","B_MRAP_01_gmg_F"], []]) inAreaArray "trialAO_1";

left arg has to be a list of objects (or positions), not strings. right arg is one of: object, location or string (marker)

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

×