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



Introduced in

Version:1.00

Description

Description:Nearest map-placed building to given object or position.

A building is defined as a map object that fulfills all of the following properties (editor-placed objects are ignored):

  • The object is an active object, with simulations turned on (getSimulationMode returns 0).
  • The object simulation type (see General Vehicle Parameters in the VBS Developer Reference) is "house".
  • None of the following CfgVehicles configuration parameters (see General Vehicle Parameters in the VBS Developer Reference) see are defined (not equal to 0):
    • transportFuel
    • transportRepair
    • transportAmmo
    • transportMaxWeapons
    • transportMaxMagazines
    • TransportWeapons
    • TransportMagazines
    • forceSupply
  • Has no MarkerLights class defined.

Syntax

Syntax:nearestBuilding object
Parameters:
  • object: Object - Object around which a building is being searched for (map-wide).
Return Value:Object - Nearest building. If none is found, objNull is returned.

Alternative Syntax

Syntax:nearestBuilding center (V3.0+)
Parameters:
Return Value:Object - Nearest building. If none is found, objNull is returned.

Examples

Examples:
_nBuilding = nearestBuilding player
_nBuilding = nearestBuilding [3000,3000]

Additional Information

See also: nearestBuildings, nearestObject, nearestObjects, nearObjects
Multiplayer:
Problems:

Notes