{"name":"inAreaArrayIndexes","operator":null,"title":"inAreaArrayIndexes","type":"command","url":"https://community.bistudio.com/wiki/inAreaArrayIndexes","revid":370140,"updated":"2024-11-01T21:37:46Z","groups":["Triggers","Markers","Locations","Positions","Groups"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.14"}],"since":{"game":"arma3","name":"Arma 3","version":"2.14"},"arma3_since":"2.14","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns indices of positions that are within the provided area.\n\n> [!IMPORTANT]\n> Unlike inAreaArray, all positions sent to this command are treated as PositionASL but the center as PositionAGL.\n\n> [!IMPORTANT]\n> Since Arma 3 v2.20 this command is fully compatible with inAreaArray, i.e by default all positions given as Array or as objects are treated as PositionAGL. There is also an option to force them to PositionWorld format.","syntaxes":[{"syntax":"positions inAreaArrayIndexes 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: Numbers","types":["Array","Number"],"description":"indexes of matched positions in positions array","text":"Array: Numbers - indexes of matched positions in positions array"},"form":"binary","operator":null,"left":{"text":"positions","types":["Array","Object","Position"]},"right":{"text":"area","types":["Object","Location","String"]}},{"syntax":"positions inAreaArrayIndexes [centre, a, b, angle, isRectangle, c, usePosWorld]","since":null,"effect":null,"exec":null,"params":[{"name":"positions","type":"Array","optional":false,"default":null,"description":"Objects and/or Positions to check (see note in description)","types":["Array"],"since":null,"text":"positions: Array - Objects and/or Positions to check (see note in description)"},{"name":"centre","type":"Array","optional":false,"default":null,"description":"Position Object or Group (see note in description)","types":["Array"],"since":null,"text":"centre: Array - Position Object or Group (see note in description)"},{"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: Numbers","types":["Array","Number"],"description":"indexes of matched positions in positions array","text":"Array: Numbers - indexes of matched positions in positions array"},"form":"binary","operator":null,"left":{"text":"positions","types":["Array"]},"right":{"text":"[centre, a, b, angle, isRectangle, c, usePosWorld]","types":["Array"]}},{"syntax":"positions inAreaArrayIndexes [pos1, pos2, pos3,...]","since":null,"effect":null,"exec":null,"params":[{"name":"positions","type":"Array","optional":false,"default":null,"description":"Objects and/or Positions to check.","types":["Array"],"since":null,"text":"positions: Array - Objects and/or Positions 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: Numbers","types":["Array","Number"],"description":"indexes of matched positions in positions array","text":"Array: Numbers - indexes of matched positions in positions array"},"form":"binary","operator":null,"left":{"text":"positions","types":["Array"]},"right":{"text":"[pos1, pos2, pos3,...]","types":["Array"]}}],"examples":[{"text":"```sqf\nprivate _players = call BIS_fnc_listPlayers;\nprivate _indices = _players inAreaArrayIndexes _marker;\n{\n    private _player = _players select _x;\n    [\"You are in the marker!\"] remoteExec [\"hint\", _player];\n} forEach _indices;\n```","code":["private _players = call BIS_fnc_listPlayers;\nprivate _indices = _players inAreaArrayIndexes _marker;\n{\n\tprivate _player = _players select _x;\n\t[\"You are in the marker!\"] remoteExec [\"hint\", _player];\n} forEach _indices;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["inAreaArray","inArea","triggerArea"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Groups","Command Group: Locations","Command Group: Markers","Command Group: Positions","Command Group: Triggers","Introduced with Arma 3 version 2.14","Scripting Commands"]}