Class Player

Represents an in-game player.

Hierarchy

Constructors

Properties

_demo: DemoFile
_steam64IdCache: undefined | string
classId: number

Server class ID.

clientSlot: number
deleting: boolean = false

Entity is scheduled for removal this tick.

index: number

Entity index.

props: CCSPlayer
serialNum: number

Serial number.

Accessors

  • get cashSpendThisRound(): number
  • Returns

    Cash that this player has spent this round

    Returns number

  • get freezeTimeEndEquipmentValue(): number
  • Returns

    Freeze time end equipment value

    Returns number

  • get handle(): number
  • Returns

    Number uniquely identifying this entity. Should be unique throughout the entire demo.

    Returns number

  • get isControllingBot(): boolean
  • Returns

    Does the player is controlling a BOT?

    Returns boolean

  • get isDormant(): boolean
  • True if this entity is out of the PVS. Always false on GOTV demos as all entities are always in the PVS.

    Returns boolean

  • get isDucking(): boolean
  • Returns

    Player is transitioning from ducked -> standing or standing -> ducked

    Returns boolean

  • get isRecordingDemo(): boolean
  • Returns

    true if this player is recording the demo from their POV.

    Returns boolean

  • get isSpotted(): boolean
  • Returns

    Has this player been spotted by any others?

    Returns boolean

  • get modelName(): null | string
  • Returns

    Name of the model that should be rendered for this entity. (e.g. 'models/Weapons/w_eq_smokegrenade_thrown.mdl')

    Returns null | string

  • get teamNumber(): number
  • Returns

    Team number (0: Unassigned, 1: Spectator, 2: Terrorist, 3: Counter-Terrorist)

    Returns number

Methods

  • Interpret an array-like data table (e.g., m_iAmmo) as an array

    Type Parameters

    • TableName extends keyof CCSPlayer

    • TableKeys extends string | number | symbol

    • ArrayType extends undefined | readonly CCSPlayer[TableName][TableKeys][]

    Parameters

    • tableName: TableName

      Name of the data table

    Returns ArrayType

  • Retrieves the value of a networked property

    Returns

    Property value, undefined if non-existent

    Type Parameters

    • Table extends keyof CCSPlayer

    • VarName extends string | number | symbol

    Parameters

    • tableName: Table

      Table name (e.g., DT_BaseEntity)

    • varName: VarName

      Network variable name (e.g., m_vecOrigin)

    Returns CCSPlayer[Table][VarName]

  • Checks if this player has spotted another. Can still return true even if this player is dead.

    Returns

    Has this player spotted the other?

    Parameters

    • other: Player

      Other player entity

    Returns boolean

  • Checks if this player has been spotted by the other. Note that this still returns true if spotted by the other player even if the other player is dead.

    Returns

    Is this player spotted by the other?

    Parameters

    • other: Player

      Other player entity

    Returns boolean

  • Retrieves the value of an array property on the singleton entity DT_CSPlayerResource.

    Returns

    Property value

    Type Parameters

    • TableName extends keyof CCSPlayerResource

    • TableKeys extends string | number | symbol

    • ElementType

    Parameters

    • tableName: TableName

    Returns ElementType

  • Update the value of a prop

    Type Parameters

    • Table extends keyof CCSPlayer

    • VarName extends string | number | symbol

    • PropType

    Parameters

    • tableName: Table

      Name of the data table

    • varName: VarName

      Name of the prop to update

    • newValue: PropType

      New prop value

    Returns void

Generated using TypeDoc