inAreaArrayIndexes: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fix)
No edit summary
Line 16: Line 16:
|descr= Returns indices of positions that are within the provided area.
|descr= Returns indices of positions that are within the provided area.


{{Feature|important|Unlike [[inAreaArray]], ''area'' position is [[Position#PositionASL|PositionASL]].}}
{{Feature|important|Unlike [[inAreaArray]], ''area'' 'center' position is [[Position#PositionASL|PositionASL]].}}


|s1= positions [[inAreaArrayIndexes]] area
|s1= positions [[inAreaArrayIndexes]] area

Revision as of 17:29, 14 May 2024

Hover & click on the images for description

Description

Description:
Returns indices of positions that are within the provided area.
Unlike inAreaArray, area 'center' position is PositionASL.
Groups:
TriggersMarkersLocationsPositionsGroups

Syntax

Syntax:
positions inAreaArrayIndexes area
Parameters:
positions: Array of Objects and/or Positions and/or Locations and/or Strings and/or Groups, where:
area: Array or Object or Location or String, where:
  • Array - in format:
    • [centre, a, b, angle, isRectangle, c] - area
      • centre: Array format PositionASL
      • a: Number - area X size / 2, in metres
      • b: Number - area Y size / 2, in metres
      • angle: Number - area rotation in degrees
      • isRectangle: Boolean - as the name says
      • c: Number - area Z size / 2; -1 for infinite height
    • [point1, point2, point3, ...] - polygon
  • Object - trigger
  • Location - location
  • String - marker
Return Value:
Array of Numbers - indices of positions's matching elements

Examples

Example 1:
private _players = call BIS_fnc_listPlayers; private _indices = _players inAreaArrayIndexes _marker; { private _player = _players select _x; ["You are in the marker!"] remoteExec ["hint", _player]; } forEach _indices;

Additional Information

See also:
inAreaArray inArea triggerArea

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note