Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Game

Hierarchy

  • Game

Index

Accessors

Static CurrentInputMode

  • Get current input mode.

    Returns InputMode

    InputMode: Mouse & Keyboard or GamePad.

Static FPS

  • get FPS(): number
  • Gets the current frame rate per second

    Returns number

Static FrameCount

  • get FrameCount(): number
  • Gets the total amount of frames rendered in this session

    Returns number

Static GameTime

  • get GameTime(): number
  • Gets how many milliseconds the game has been open this session

    Returns number

Static IsCutsceneActive

  • get IsCutsceneActive(): boolean

Static IsLoading

  • get IsLoading(): boolean
  • Get if a loading screen is active.

    Returns boolean

Static IsMissionActive

  • get IsMissionActive(): boolean
  • set IsMissionActive(toggle: boolean): void

Static IsPaused

  • get IsPaused(): boolean
  • set IsPaused(toggle: boolean): void
  • Is the player in the pause menu (ESC).

    Returns boolean

  • Force enable pause menu.

    Parameters

    • toggle: boolean

    Returns void

Static IsRandomEventActive

  • get IsRandomEventActive(): boolean
  • set IsRandomEventActive(toggle: boolean): void

Static IsWaypointActive

  • get IsWaypointActive(): boolean
  • Is a waypoint set on the map.

    Returns boolean

Static Language

Static LastFrameTime

  • get LastFrameTime(): number
  • Gets the time it currently takes to render a frame, in seconds;

    Returns number

Static MaxPlayers

  • get MaxPlayers(): number
  • Get the max players allowed on the server (Not working since Convar isn't replicated).

    Returns number

Static MaxWantedLevel

  • get MaxWantedLevel(): number
  • set MaxWantedLevel(value: number): void
  • Get the maximum wanted level.

    Returns number

  • Set the maximum wanted level the local client can get.

    Parameters

    • value: number

    Returns void

Static Nightvision

  • get Nightvision(): boolean
  • set Nightvision(toggle: boolean): void
  • Get if nightvision is active.

    Returns boolean

  • Toggle nightvision.

    Parameters

    • toggle: boolean

    Returns void

Static Player

Static PlayerPed

  • get PlayerPed(): Ped
  • Get the local player character's Ped object.

    Returns Ped

    A local player's character.

Static PlayerVersusPlayer

  • get PlayerVersusPlayer(): boolean
  • set PlayerVersusPlayer(value: boolean): void
  • Get whether PvP is enabled.

    Returns boolean

    True if enabled.

  • Set whether PvP is enabled.

    Parameters

    • value: boolean

    Returns void

    True if enabled.

Static ShowPoliceBlipsOnRadar

  • set ShowPoliceBlipsOnRadar(toggle: boolean): void
  • Set whether police blips should show on minimap.

    Parameters

    • toggle: boolean

    Returns void

Static ThermalVision

  • get ThermalVision(): boolean
  • set ThermalVision(toggle: boolean): void
  • Get if thermal (heat) vision is active.

    Returns boolean

  • Toggle thermal (heat) vision.

    Parameters

    • toggle: boolean

    Returns void

Static TimeScale

  • set TimeScale(time: number): void
  • Sets the time scale of the Game.

    Parameters

    • time: number

      The time scale, only accepts values between 0.0 and 1.0

    Returns void

Static WantedMultiplier

  • set WantedMultiplier(value: number): void
  • Set the multiplier of the wanted level.

    Parameters

    • value: number

    Returns void

Methods

Static entityFromHandle

  • Get an entity object from an entity handle.

    Parameters

    • handle: number

      Handle of entity

    Returns Ped | Vehicle | Prop | undefined

    A Ped, Vehicle or Prop object. undefined if entity handle doesn't exist.

Static generateHash

  • generateHash(input: string): number
  • Calculate the Jenkins One At A Time (joaat) has from the given string.

    Parameters

    • input: string

      The input string to calculate the hash

    Returns number

Static isControlJustPressed

  • isControlJustPressed(index: number, control: Control): boolean
  • Check whether a control has been pressed since last check.

    Parameters

    • index: number

      input group (usually 0)

    • control: Control

      Control

    Returns boolean

    True or False.

Static isControlJustReleased

  • isControlJustReleased(index: number, control: Control): boolean
  • Check whether a control has been released since last check.

    Parameters

    • index: number

      input group (usually 0)

    • control: Control

      Control

    Returns boolean

    True or False.

Static isControlPressed

  • isControlPressed(index: number, control: Control): boolean
  • Check whether a control is currently pressed.

    Parameters

    • index: number

      input group (usually 0)

    • control: Control

      Control

    Returns boolean

    True or False.

Static isControlReleased

  • isControlReleased(index: number, control: Control): boolean
  • Check whether a control is being released.

    Parameters

    • index: number

      input group (usually 0)

    • control: Control

      Control

    Returns boolean

    True or False.

Static isDisabledControlJustPressed

  • isDisabledControlJustPressed(index: number, control: Control): boolean
  • Check whether a disabled control has been pressed since last check.

    Parameters

    • index: number

      input group (usually 0)

    • control: Control

      Control

    Returns boolean

    True or False.

Static playMusic

  • playMusic(musicFile: string): void
  • Play music. Same as Audio.playSound

    Parameters

    • musicFile: string

      Music file.

    Returns void

Static playSound

  • playSound(soundFile: string, soundSet: string): void
  • Play a sound. Same as Audio.playSound

    Parameters

    • soundFile: string

      Name of sound

    • soundSet: string

      The set where the sound is in

    Returns void

Static playerList

  • playerList(): IterableIterator<Player>
  • Get an iterable list of players currently on server.

    Returns IterableIterator<Player>

    Iterable list of Player objects.

Static stopMusic

  • stopMusic(musicFile?: string): void
  • Stop music. If musicFile is not given, last played music is stopped. Same as Audio.playSound

    Parameters

    • Optional musicFile: string

      (optional) Music file.

    Returns void

Generated using TypeDoc