Functions/DarkRP/Server/findEmptyPos

From Official DarkRP Wiki
Jump to: navigation, search
Function
Function name DarkRP.findEmptyPos(Vector pos, table ignore, number distance, number step, Vector area)
Description:
Find an empty position as close as possible to the given position (Note: this algorithm is slow!).
Returns: Vector pos
Part of Library: DarkRP
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=Functions/DarkRP/Server/findEmptyPos]DarkRP.findEmptyPos[/url][/b]

Function parameters

  1. pos (Vector)
  2. The position to check for emptiness.

  3. ignore (table) (optional)
  4. Table of things the algorithm can ignore.

  5. distance (number)
  6. The maximum distance to look for empty positions.

  7. step (number)
  8. The size of the steps to check (it places it will look are STEP units removed from one another).

  9. area (Vector)
  10. The hull to check, this is Vector(16, 16, 64) for players.


Function return values

  1. pos (Vector)
  2. A found position. When no position was found, the parameter is returned