OPX//77
opx_lib

Lib.Players

Last updated on

The players this client knows, who is near, and their bodies.

No permission declared by the module.

Lib.Players.All

Every player this client knows, by player id ascending.

Lib.Players.All(options)

Parameters

  • options?: table

Returns

  • Result — array

Lib.Players.LocalId

The local player's id.

Lib.Players.LocalId()

Returns

  • Result — id

Lib.Players.Nearby

Players with a body within radius, nearest first.

Lib.Players.Nearby(radius, options)

Parameters

  • radius: number — metres
  • options?: table
    • origin?: { x, y, z }
    • includeSelf?: boolean
    • limit?: integer

Returns

  • Result — array; errors invalid_radius, invalid_options
Example
local near = Lib.Players.Nearby(5.0, { limit = 3 })

Lib.Players.Closest

The nearest player with a body.

Lib.Players.Closest(options)

Parameters

  • options?: table

Returns

  • Result — one row; error not_found

Lib.Players.Entity

The entity handle of one player's body on this client.

Lib.Players.Entity(playerId)

Parameters

  • playerId: number

Returns

  • Result — entity handle; errors invalid_player, no_body

Lib.Players.FromEntity

The player an entity belongs to.

Lib.Players.FromEntity(entity)

Parameters

  • entity: number

Returns

  • Result — player id; errors invalid_entity, not_a_player

On this page