{"name":"inArea","operator":null,"title":"inArea","type":"command","url":"https://community.bistudio.com/wiki/inArea","revid":377541,"updated":"2026-01-02T06:54:31Z","groups":["Triggers","Markers","Locations","Positions"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.58"}],"since":{"game":"arma3","name":"Arma 3","version":"1.58"},"arma3_since":"1.58","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Checks whether given position or object is inside given area. Use inAreaArray to check multiple positions/objects within area.\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.\n\n> [!NOTE]\n> This command also supports hexagon area which can be created from ellipse when both a and b are negative.\n> Hexagon ellipses are also supported by both marker creation and drawEllipse.","syntaxes":[{"syntax":"position inArea area","since":null,"effect":null,"exec":null,"params":[{"name":"position","type":null,"optional":false,"default":null,"description":"Object or Position2D or Position3D (must be PositionAGL if area is checked in 3D)","types":["Object","Position2D","Position3D","PositionAGL"],"since":null,"text":"position: Object or Position2D or Position3D (must be PositionAGL if area is checked in 3D)"},{"name":"area","type":"Object, String, Location","optional":false,"default":null,"description":"Object, String, Location\n- Object - trigger\n- String - marker name\n- Location - location","types":["Object","String","Location"],"since":null,"text":"area: Object, String, Location\n- Object - trigger\n- String - marker name\n- Location - location"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"binary","operator":null,"left":{"text":"position","types":["Object","Position2D","Position3D","PositionAGL"]},"right":{"text":"area","types":["Object","String","Location"]}},{"syntax":"position inArea [center, a, b, angle, isRectangle, c, usePosWorld]","since":null,"effect":null,"exec":null,"params":[{"name":"position","type":null,"optional":false,"default":null,"description":"Object and/or Position to check. Position must be PositionAGL if area is checked in 3D (see note in description)","types":[],"since":null,"text":"position: - Object and/or Position to check. Position must be PositionAGL if area is checked in 3D (see note in description)"},{"name":"center","type":"Array or Object","optional":false,"default":null,"description":"center of the area in format Position2D, Position3D (must be PositionAGL if area is checked in 3D), Object or Group","types":["Array","Object"],"since":null,"text":"center: Array or Object - center of the area in format Position2D, Position3D (must be PositionAGL if area is checked in 3D), 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 since 2.20, 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 since 2.20, 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":"arma3 1.60","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":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"binary","operator":null,"left":{"text":"position","types":[]},"right":{"text":"[center, a, b, angle, isRectangle, c, usePosWorld]","types":["Array"]}}],"examples":[{"text":"```sqf\n_playerIsInside = player inArea _myTrigger;\n```","code":["_playerIsInside = player inArea _myTrigger;"]},{"text":"```sqf\n_positionIsInside = _myPosition inArea [[100, 100, 0], 20, 30, 45, false];\n```","code":["_positionIsInside = _myPosition inArea [[100, 100, 0], 20, 30, 45, false];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["inAreaArray","triggerArea","in","inPolygon","drawEllipse","drawRectangle","createTrigger","createMarker","createLocation"],"notes":[],"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.58","Scripting Commands"]}