nearestObject: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Added links.)
mNo edit summary
Line 1: Line 1:
[[Category:Scripting Commands|NEARESTOBJECT]]
{{Command|= Comments
[[Category:Scripting Commands OFP 1.96|NEARESTOBJECT]]
____________________________________________________________________________________________
[[Category:Scripting Commands OFP 1.46|NEARESTOBJECT]]
[[Category:Scripting Commands ArmA|NEARESTOBJECT]]


| ofp |= Game name


<h2 style="color:#000066">'''nearestObject ''pos'''''</h2>
|1.00|= Game version
____________________________________________________________________________________________


| Nearest object of given type to given position. For nearestObject pos, pos may be [x, y ,z, "type"] or [object, "type"] or even [x, y, z]. |= Description
____________________________________________________________________________________________


'''Operand types:'''
| '''nearestObject''' pos |= Syntax


'''pos:''' [[Array]]
|p1= pos: [[Array]] |= Parameter 1


'''Type of returned value:'''
| [[Object]] |= Return value
____________________________________________________________________________________________
 
|x1= <pre>_nObject = nearestObject [ [[player]], "StreetLamp"]
Comments This command can only find objects up to 50 meters away.</pre> |= Example 1
____________________________________________________________________________________________


[[Object]]
|  |= See also


'''Compatibility:'''
}}


Binary variants [[nearestObject id]] and [[nearestObject type]] were added in '''Armed Assault'''
<h3 style="display:none">Notes</h3>


'''Description:'''
<dl class="command_description">
<!-- Note Section BEGIN -->


Nearest '''object''' of given type to given '''position'''.
<!-- Note Section END -->
</dl>


For '''nearestObject ''pos''''', '''pos''' may be '''''[x, y ,z, "type"]''''' or '''''[object, "type"]''''' or even '''''[x, y, z]'''''.
<h3 style="display:none">Bottom Section</h3>


 
[[Category:Scripting Commands|NEARESTOBJECT]]
'''Example:'''
[[Category:Scripting Commands OFP 1.96|NEARESTOBJECT]]
 
[[Category:Scripting Commands OFP 1.46|NEARESTOBJECT]]
_nObject = '''nearestObject''' [ [[player]], "StreetLamp"]
[[Category:Scripting Commands ArmA|NEARESTOBJECT]]
 
 
'''Comments'''
 
This command can only find objects up to 50 meters away.

Revision as of 23:31, 1 August 2006

Hover & click on the images for description

Description

Description:
Nearest object of given type to given position. For nearestObject pos, pos may be [x, y ,z, "type"] or [object, "type"] or even [x, y, z].
Groups:
Uncategorised

Syntax

Syntax:
nearestObject pos
Parameters:
pos: Array
Return Value:
Object

Examples

Example 1:
_nObject = nearestObject [ [[player]], "StreetLamp"] 
Comments This command can only find objects up to 50 meters away.

Additional Information

See also:
See also needed

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

Notes

Bottom Section