isOnRoad: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 19: | Line 19: | ||
|descr= Checks if given position is inside road segment. Same as [[roadAt]], only return is boolean instead of road object. | |descr= Checks if given position is inside road segment. Same as [[roadAt]], only return is boolean instead of road object. | ||
|s1= | |s1= [[isOnRoad]] position | ||
|p1= position: [[Object]] or [[Array]] in format [[PositionAGL]] (especially on bridges) or | |p1= position: [[Object]] or [[Array]] in format [[Position#PositionAGL|PositionAGL]] (especially on bridges) or {{GVI|arma3|2.00|size= 0.75}} [[Position#Introduction|Position2D]], in which case Z will be automatically deduced as the height of the road surface | ||
|r1= [[Boolean]] | |r1= [[Boolean]] | ||
|x1= < | |x1= <sqf>_objOnRoad = isOnRoad player;</sqf> | ||
|x2= < | |x2= <sqf>_posOnRoad = isOnRoad ASLToAGL getPosASL player;</sqf> | ||
|seealso= [[nearRoads]] | |seealso= [[nearRoads]] [[roadsConnectedTo]] [[roadAt]] [[surfaceIsWater]] [[getRoadInfo]] [[nearestTerrainObjects]] | ||
}} | }} | ||
{{Note | |||
|user= Tankbuster | |||
|timestamp= 20171124213100 | |||
|text= Some roadobjects will return false when using this command. invisibleroadway_square_f.p3d is found by the nearRoads command, yet will return false for isOnRoad. | |||
}} | |||
Some roadobjects will return false when using this command. invisibleroadway_square_f.p3d is found by the nearRoads command, yet will return false for isOnRoad. | |||
Latest revision as of 15:30, 17 April 2023
Description
- Description:
- Checks if given position is inside road segment. Same as roadAt, only return is boolean instead of road object.
- Groups:
- Roads and Airports
Syntax
- Syntax:
- isOnRoad position
- Parameters:
- position: Object or Array in format PositionAGL (especially on bridges) or 2.00 Position2D, in which case Z will be automatically deduced as the height of the road surface
- Return Value:
- Boolean
Examples
- Example 1:
- Example 2:
Additional Information
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
- Posted on Nov 24, 2017 - 21:31 (UTC)
- Some roadobjects will return false when using this command. invisibleroadway_square_f.p3d is found by the nearRoads command, yet will return false for isOnRoad.