Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.00

Description

Description:Nearest object of given type to given position within a range of 50 meters.

Syntax

Syntax:nearestObject filter
Parameters:
  • filter: Array - Can be one of the following:
    • [x,y,z]: Any objects near position.
    • [[x,y,z], "type"]: Objects of class type near position [x,y,z].
    • [object, "type"]: Objects of class type near position of object.
Return Value:Object - Found object, or objNull, if nothing is found within range.

Alternative Syntax

Syntax:position nearestObject filter
Parameters:
Return Value:Object - Found object, or objNull, if nothing is found within range.

Examples

Examples:
_nObject = nearestObject [2345,6789]
_nObject = nearestObject [player, "StreetLamp"] 
_nObject = getPos player nearestObject 123456
_nObject = getPos player nearestObject "StreetLamp"

Additional Information

See also: nearestObjects, nearObjects, nearEntities
Multiplayer: 
Problems: 

Notes