Skip to content

PlayerManager

@vimp-mp/types 2.0.1

Interface · Client API

Provides access to the local player and remote players known to the client.

ts
interface PlayerManager

Members

all

ts
readonly all: Array<Player>

Remote players currently known to this client. Excludes the local player; use local/localId for that. Order is unspecified.

count

ts
readonly count: number

Count of remote players in all (does not include local).

local

ts
readonly local: Player | null

The local player, or null if the handshake has not assigned an id yet (i.e. we just started and haven't connected to a server).

localId

ts
readonly localId: number | null

Numeric id of the local player, or null if no handshake yet. Cheap to call — backed by a single op lookup with no allocation.

getById

ts
getById(id: number): Player | null

Lookup by player id. Returns the local player too if its id is passed.

VIMP developer documentation