Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Player

Hierarchy

Index

Properties

Readonly aimPos

aimPos: Vector3

Position the player is currently aiming at

beta

Readonly armour

armour: number

Current armour

beta

Readonly currentWeapon

currentWeapon: number

Currently equipped weapon

beta

Readonly currentWeaponComponents

currentWeaponComponents: Array<number>

Current weapon components

beta

Readonly currentWeaponTintIndex

currentWeaponTintIndex: number

Tint index for currently equipeed weapon

beta

Readonly entityAimOffset

entityAimOffset: Vector3 | null

The current aim offset of the player

beta

Readonly entityAimingAt

entityAimingAt: Entity | null

The entity the player is aiming at

beta

Readonly flashlightActive

flashlightActive: boolean

Is the flashlight of the player activated

beta

Readonly headRot

headRot: Vector3

Rotation of the head of the player

beta

Readonly health

health: number

Current health of the player

beta

Readonly id

id: number

Entity unique id

Readonly isAiming

isAiming: boolean

Is the player currently aiming

beta

Readonly isInRagdoll

isInRagdoll: boolean

Is the player currently in ragdoll

beta

Readonly isJumping

isJumping: boolean

Is the player currently jumping

beta

Readonly isReloading

isReloading: boolean

Is the player currently reloading their weapon

beta

Readonly isShooting

isShooting: boolean

Is the player currently shooting with a weapon

beta

Readonly isTalking

isTalking: boolean

Player talking state

Readonly maxArmour

maxArmour: number

Max available armour value

beta

Readonly maxHealth

maxHealth: number

Current max health of the player

beta

Readonly micLevel

micLevel: number

Player talking volume

Readonly model

model: number

Hash of entity model

Readonly moveSpeed

moveSpeed: number

Current player movement speed

beta

Readonly name

name: string

Player name

Readonly pos

pos: Vector3

Object position

Readonly rot

rot: Vector3

Entity rotation in radians

Readonly scriptID

scriptID: number

Internal game id that can be used in native calls

Readonly seat

seat: number

Curent seat the player is sitting in

beta

Readonly type

Type of the object.

Readonly valid

valid: boolean

Object usability.

returns

False if object is no longer usable.

Readonly vehicle

vehicle: Vehicle | null

Player's vehicle, null if player is not in any vehicle

Readonly visible

visible: boolean
beta

Static Readonly all

all: Array<Player>

Array with all players

Static Readonly local

local: Player

Local player

Methods

deleteMeta

  • deleteMeta(key: string): void

destroy

  • destroy(): void

getMeta

  • getMeta(key: string): any
  • Gets a value using the specified key.

    Parameters

    • key: string

      The key of the value to get.

    Returns any

    Dynamic value associated with the specified key.

getStreamSyncedMeta

  • getStreamSyncedMeta(key: string): any

getSyncedMeta

  • getSyncedMeta(key: string): any
  • Gets a value using the specified key.

    Parameters

    • key: string

      The key of the value to get.

    Returns any

    Dynamic value associated with the specified key.

hasMeta

  • hasMeta(key: string): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    True when element associated with the specified key is stored.

hasStreamSyncedMeta

  • hasStreamSyncedMeta(key: string): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    Return is dependent on whether element associated with the specified key is stored.

hasSyncedMeta

  • hasSyncedMeta(key: string): boolean
  • Determines whether contains the specified key.

    Parameters

    • key: string

      The key of the value to locate.

    Returns boolean

    Return is dependent on whether element associated with the specified key is stored.

setMeta

  • setMeta(key: string, value: any): void
  • Stores the given value with the specified key.

    remarks

    The given value will be shared locally.

    Parameters

    • key: string

      The key of the value to store.

    • value: any

    Returns void

Static getByID

  • getByID(id: number): Player | null
  • Retrieves the player from the pool.

    Parameters

    • id: number

      The id of the player.

    Returns Player | null

    Entity if it was found, otherwise null.

Static getByScriptID

  • getByScriptID(scriptID: number): Player | null