PlayerManager
@vimp-mp/types 2.0.1Provides access to the local player and remote players known to the client.
ts
interface PlayerManagerMembers
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: numberCount of remote players in all (does not include local).
local
ts
readonly local: Player | nullThe 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 | nullNumeric 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 | nullLookup by player id. Returns the local player too if its id is passed.