{"name":"inAreaArray","operator":null,"title":"inAreaArray","type":"command","url":"https://community.bistudio.com/wiki/inAreaArray","revid":378040,"updated":"2026-01-27T13:05:40Z","groups":["Triggers","Markers","Locations","Positions"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.66"}],"since":{"game":"arma3","name":"Arma 3","version":"1.66"},"arma3_since":"1.66","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns given list of Objects and/or Positions that are in the given area, area defined by a trigger, marker, location or array.\n\n> [!IMPORTANT]\n> By default all positions given as Array or as objects are treated as PositionAGL. Since Arma 3 v2.20 there is an option to force them to PositionWorld format.","syntaxes":[{"syntax":"positions inAreaArray area","since":null,"effect":null,"exec":null,"params":[{"name":"positions","type":"Array of Objects and/or Positions","optional":false,"default":null,"description":null,"types":["Array","Object","Position"],"since":null,"text":"positions: Array of Objects and/or Positions"},{"name":"area","type":"Object, Location or String","optional":false,"default":null,"description":"the defined area:\n- Object - trigger\n- Location - location\n- String - marker name","types":["Object","Location","String"],"since":null,"text":"area: Object, Location or String - the defined area:\n- Object - trigger\n- Location - location\n- String - marker name"}],"returns":{"type":"Array of Objects and/or Positions","types":["Array","Object","Position"],"description":null,"text":"Array of Objects and/or Positions"},"form":"binary","operator":null,"left":{"text":"positions","types":["Array","Object","Position"]},"right":{"text":"area","types":["Object","Location","String"]}},{"syntax":"positions inAreaArray [centre, a, b, angle, isRectangle, c, usePosWorld]","since":null,"effect":null,"exec":null,"params":[{"name":"positions","type":"Array of Objects and/or Positions","optional":false,"default":null,"description":"Places to check. Positions must be PositionAGL if area is checked in 3D (see note in description)","types":["Array","Object","Position"],"since":null,"text":"positions: Array of Objects and/or Positions - Places to check. Positions must be PositionAGL if area is checked in 3D (see note in description)"},{"name":"centre","type":"Position2D, PositionAGL, Arma 3 v2.14 Object or Group","optional":false,"default":null,"description":null,"types":["Position2D","PositionAGL","Object","Group"],"since":null,"text":"centre: Position2D, PositionAGL, Arma 3 v2.14 Object or Group"},{"name":"a","type":"Number","optional":false,"default":null,"description":"x axis (x / 2)","types":["Number"],"since":null,"text":"a: Number - x axis (x / 2)"},{"name":"b","type":"Number","optional":false,"default":null,"description":"y axis (y / 2)","types":["Number"],"since":null,"text":"b: Number - y axis (y / 2)"},{"name":"angle","type":"Number","optional":true,"default":"0","description":"rotation angle","types":["Number"],"since":null,"text":"angle: Number - (Optional, default 0) rotation angle"},{"name":"isRectangle","type":"Boolean","optional":true,"default":"false","description":"true if rectangle, false if ellipse","types":["Boolean"],"since":null,"text":"isRectangle: Boolean - (Optional, default false) true if rectangle, false if ellipse"},{"name":"c","type":"Number","optional":true,"default":"-1: unlimited","description":"z axis (z / 2)","types":["Number"],"since":null,"text":"c: Number - (Optional, default -1: unlimited) z axis (z / 2)"},{"name":"usePosWorld","type":"Boolean","optional":true,"default":"false","description":"set to true to treat all positions as PositionWorld","types":["Boolean"],"since":"Arma3 2.20","text":"usePosWorld: Boolean - (Optional, default false) set to true to treat all positions as PositionWorld"}],"returns":{"type":"Array of Objects and/or Positions","types":["Array","Object","Position"],"description":null,"text":"Array of Objects and/or Positions"},"form":"binary","operator":null,"left":{"text":"positions","types":["Array","Object","Position"]},"right":{"text":"[centre, a, b, angle, isRectangle, c, usePosWorld]","types":["Array"]}},{"syntax":"positions inAreaArray [pos1, pos2, pos3,...]","since":"arma3 2.20","effect":null,"exec":null,"params":[{"name":"positions","type":"Array of Objects and/or Positions","optional":false,"default":null,"description":"places to check.","types":["Array","Object","Position"],"since":null,"text":"positions: Array of Objects and/or Positions - places to check."},{"name":"posN","type":"Position","optional":false,"default":null,"description":"polygon vertices in 2d or 3d format (see inPolygon)","types":["Position"],"since":null,"text":"posN: Position - polygon vertices in 2d or 3d format (see inPolygon)"}],"returns":{"type":"Array of Objects and/or Positions","types":["Array","Object","Position"],"description":null,"text":"Array of Objects and/or Positions"},"form":"binary","operator":null,"left":{"text":"positions","types":["Array","Object","Position"]},"right":{"text":"[pos1, pos2, pos3,...]","types":["Array"]}}],"examples":[{"text":"```sqf\nvehicles inAreaArray myTrigger;\n```","code":["vehicles inAreaArray myTrigger;"]},{"text":"```sqf\nallUnits inAreaArray \"myMarker\";\n```","code":["allUnits inAreaArray \"myMarker\";"]},{"text":"```sqf\nallPlayers inAreaArray myLocation;\n```","code":["allPlayers inAreaArray myLocation;"]},{"text":"```sqf\nallDead inAreaArray [[100, 100, 0], 20, 30, 45, false, 10];\n```","code":["allDead inAreaArray [[100, 100, 0], 20, 30, 45, false, 10];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["inAreaArrayIndexes","inArea","triggerArea"],"notes":[{"user":"Tankbuster","date":"2017-06-11T21:33:00Z","text":"The array you send the command can be filtered. For example:\n\n```sqf\nvehicles select { _x isKindOf \"StaticWeapon\" } inAreaArray \"myMarker\"\n```\n\nWill return only the statics inside the given marker."}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Locations","Command Group: Markers","Command Group: Positions","Command Group: Triggers","Introduced with Arma 3 version 1.66","Scripting Commands"]}