Library find

Find library. Finds entities in various shapes.

Functions

all (filter) Finds all entitites
allPlayers (filter) Finds all players (including bots)
byClass (class, filter) Finds entities by class name
byModel (model, filter) Finds entities by model
canFind () Checks if a find function can be performed
inBox (min, max, filter) Finds entities in a box
inCone (pos, dir, distance, radius, filter) Finds entities in a cone
inSphere (center, radius, filter) Finds entities in a sphere


Functions

find_library.all (filter)
Finds all entitites

Parameters:

  • filter: Optional function to filter results, arguments: entity

Return value:

    An array of found entities
find_library.allPlayers (filter)
Finds all players (including bots)

Parameters:

  • filter: Optional function to filter results, arguments: entity

Return value:

    An array of found entities
find_library.byClass (class, filter)
Finds entities by class name

Parameters:

  • class: The class name
  • filter: Optional function to filter results, arguments: entity

Return value:

    An array of found entities
find_library.byModel (model, filter)
Finds entities by model

Parameters:

  • model: The model file
  • filter: Optional function to filter results, arguments: entity

Return value:

    An array of found entities
find_library.canFind ()
Checks if a find function can be performed

Return value:

    True if find functions can be used
find_library.inBox (min, max, filter)
Finds entities in a box

Parameters:

  • min: Bottom corner
  • max: Top corner
  • filter: Optional function to filter results, arguments: entity

Return value:

    An array of found entities
find_library.inCone (pos, dir, distance, radius, filter)
Finds entities in a cone

Parameters:

  • pos: The cone vertex position
  • dir: The direction to project the cone
  • distance: The length to project the cone
  • radius: The angle of the cone
  • filter: Optional function to filter results, arguments: entity

Return value:

    An array of found entities
find_library.inSphere (center, radius, filter)
Finds entities in a sphere

Parameters:

  • center: Center of the sphere
  • radius: Sphere radius
  • filter: Optional function to filter results, arguments: entity

Return value:

    An array of found entities

Valid XHTML 1.0!