roadAt: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^ ]*)\{\{cc\|([^ ]*)\}\}([^ ]*)<\/code>" to "<code>$1// $2$3</code>") |
Lou Montana (talk | contribs) m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>") |
||
Line 15: | Line 15: | ||
|r1= [[Object]] - road segment or [[objNull]] | |r1= [[Object]] - road segment or [[objNull]] | ||
|x1= < | |x1= <sqf>_road = roadAt ASLToAGL getPosASL player;</sqf> | ||
|x2= < | |x2= <sqf>_isOnRoad = !isNull roadAt player;</sqf> | ||
|x3= For detecting bridges, for example<code>getModelInfo (roadAt ASLToAGL getPosASL player); // ["bridgesea_01_f.p3d","a3\structures_f_exp\infrastructure\bridges\bridgesea_01_f.p3d",true]</code> | |x3= For detecting bridges, for example<code>getModelInfo (roadAt ASLToAGL getPosASL player); // ["bridgesea_01_f.p3d","a3\structures_f_exp\infrastructure\bridges\bridgesea_01_f.p3d",true]</code> |
Revision as of 10:24, 13 May 2022
Description
- Description:
- Returns a road segment containing given position, objNull otherwise. Same as isOnRoad only returns the actual road object instead of boolean.
- Groups:
- Roads and Airports
Syntax
- Syntax:
- roadAt position
- Parameters:
- position: Object or Array - Array in format PositionAGL (especially on bridges) or (since Arma 3 v2.00) Position2D, in which case Z will be automatically deduced as the height of the road surface
- Return Value:
- Object - road segment or objNull
Examples
- Example 1:
- Example 2:
- Example 3:
- For detecting bridges, for example
getModelInfo (roadAt ASLToAGL getPosASL player); // ["bridgesea_01_f.p3d","a3\structures_f_exp\infrastructure\bridges\bridgesea_01_f.p3d",true]
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