Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "alt-client"

Index

Variables

Const Branch

Branch: string

Represents the current client branch.

beta

Const Version

Version: string

Represents the current client version.

remarks

It's a slighty modified semantic versioning specification, which can be matched using this regular expression pattern ^(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))$.

beta

Functions

addGxtText

  • addGxtText(key: string, value: string): void

beginScaleformMovieMethodMinimap

  • beginScaleformMovieMethodMinimap(methodName: string): boolean

clearEveryTick

  • clearEveryTick(id: number): void

clearInterval

  • clearInterval(id: number): void

clearNextTick

  • clearNextTick(id: number): void

clearTimeout

  • clearTimeout(id: number): void

deleteMeta

  • deleteMeta(key: string): void
  • Removes the specified key.

    Parameters

    • key: string

      The key of the value to remove.

    Returns void

emit

  • emit(name: string, ...args: any[]): void
  • Emits specified event across client resources.

    Parameters

    • name: string
    • Rest ...args: any[]

      Rest parameters for emit to send.

    Returns void

emitServer

  • emitServer(name: string, ...args: any[]): void
  • Emits specified event to server.

    Parameters

    • name: string
    • Rest ...args: any[]

      Rest parameters for emit to send.

    Returns void

everyTick

  • everyTick(handler: () => void): number
  • Schedules execution of handler on every frame.

    Parameters

    • handler: () => void

      Handler that should be scheduled for execution.

        • (): void
        • Returns void

    Returns number

    A number representing the id value of the timer that is set. Use this value with the clearEveryTick function to cancel the timer.

gameControlsEnabled

  • gameControlsEnabled(): boolean

getCursorPos

getGxtText

  • getGxtText(key: string): string

getLicenseHash

  • getLicenseHash(): string

getLocale

  • getLocale(): string

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.

getMsPerGameMinute

  • getMsPerGameMinute(): number

getStat

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.

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.

hash

  • hash(str: string): number
  • Creates a hash using Jenkins one-at-a-time algorithm.

    Parameters

    • str: string

      A string from which hash will be created.

    Returns number

isConsoleOpen

  • isConsoleOpen(): boolean
  • Returns state of console window.

    Returns boolean

    True when console window is opened.

isInSandbox

  • isInSandbox(): boolean
  • Sandbox mode.

    Returns boolean

    True when alt:V client is launched in sandbox mode.

isInStreamerMode

  • isInStreamerMode(): boolean
  • Streamer mode.

    Returns boolean

    True when alt:V client is launched in streamer mode.

isMenuOpen

  • isMenuOpen(): boolean
  • Returns state of user interface and console window.

    Returns boolean

    True when user interface or console window is opened.

isTextureExistInArchetype

  • isTextureExistInArchetype(modelHash: number, modelName: string): boolean

log

  • log(...args: any[]): void

logError

  • logError(...args: any[]): void

logWarning

  • logWarning(...args: any[]): void

nextTick

  • nextTick(handler: () => void): number
  • Schedules execution of handler on next frame.

    Parameters

    • handler: () => void

      Handler that should be scheduled for execution.

        • (): void
        • Returns void

    Returns number

    A number representing the id value of the timer that is set. Use this value with the clearNextTick function to cancel the timer.

off

  • off(eventName: string, listener: (...args: any[]) => void): void
  • Unsubscribes from client event handler with specified listener.

    remarks

    Listener should be of the same reference as when event was subscribed.

    Parameters

    • eventName: string

      Name of the event.

    • listener: (...args: any[]) => void

      Listener that should be removed.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

offServer

  • offServer(eventName: string, listener: (...args: any[]) => void): void
  • Unsubscribes from server event handler with specified listener.

    remarks

    Listener should be of the same reference as when event was subscribed.

    Parameters

    • eventName: string

      Name of the event.

    • listener: (...args: any[]) => void

      Listener that should be removed.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

on

  • on<K>(eventName: K, listener: IClientEvent[K]): void
  • on<S>(event: Exclude<S, keyof IClientEvent>, listener: (...args: any[]) => void): void
  • Subscribes to client event handler with specified listener.

    Type parameters

    Parameters

    • eventName: K

      Name of the event.

    • listener: IClientEvent[K]

      Listener that should be added.

    Returns void

  • Subscribes to client event handler with specified listener.

    Type parameters

    • S: string

    Parameters

    • event: Exclude<S, keyof IClientEvent>
    • listener: (...args: any[]) => void

      Listener that should be added.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

onServer

  • onServer(eventName: string, listener: (...args: any[]) => void): void
  • Subscribes to client event handler with specified listener.

    Parameters

    • eventName: string

      Name of the event.

    • listener: (...args: any[]) => void

      Listener that should be added.

        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

removeGxtText

  • removeGxtText(key: string): void

removeIpl

  • removeIpl(iplName: string): void

requestIpl

  • requestIpl(iplName: string): void

resetStat

setCamFrozen

  • setCamFrozen(state: boolean): void

setCursorPos

setInterval

  • setInterval(handler: () => void, miliseconds: number): number
  • Schedules execution of handler in specified intervals.

    Parameters

    • handler: () => void

      Handler that should be scheduled for execution.

        • (): void
        • Returns void

    • miliseconds: number

      The time, in milliseconds, between execution of specified handler.

    Returns number

    A number representing the id value of the timer that is set. Use this value with the clearInterval function to cancel the timer.

setMeta

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

    remarks

    The given value will be shared locally to all resources.

    Parameters

    • key: string

      The key of the value to store.

    • value: any

    Returns void

setModel

  • setModel(modelName: string): void

setMsPerGameMinute

  • setMsPerGameMinute(miliseconds: number): void

setStat

  • setStat(statName: StatName, value: number): void
  • Sets a statistic to desired value.

    Parameters

    • statName: StatName

      Name of the statistic.

    • value: number

      Value of the statistic you want to set.

    Returns void

setTimeout

  • setTimeout(handler: () => void, miliseconds: number): number
  • Schedules execution of handler once after the expiration of interval.

    Parameters

    • handler: () => void

      Handler that should be scheduled for execution.

        • (): void
        • Returns void

    • miliseconds: number

      The time, in milliseconds, before execution of specified handler.

    Returns number

    A number representing the id value of the timer that is set. Use this value with the clearTimeout function to cancel the timer.

setWeatherCycle

  • setWeatherCycle(weathers: Array<any>, multipliers: Array<any>): void

setWeatherSyncActive

  • setWeatherSyncActive(isActive: boolean): void

showCursor

  • showCursor(state: boolean): void
  • Changes the visibility of cursor.

    remarks

    This is handled by resource scoped internal integer, which gets increased/decreased by every function call. When you show your cursor 5 times, to hide it you have to do that 5 times accordingly.

    Parameters

    • state: boolean

      A boolean indicating whenever cursor should be visible or not.

    Returns void

takeScreenshot

  • takeScreenshot(stem: string): Promise<boolean>
  • Output is saved to screenshots folder in root directory.

    Parameters

    • stem: string

      Filename without extension.

    Returns Promise<boolean>

    Return is dependent on the success of the operation.

takeScreenshotBase64

  • takeScreenshotBase64(): Promise<string>
  • Output is returned as string.

    Returns Promise<string>

    Return is dependent on the success of the operation.

toggleGameControls

  • toggleGameControls(state: boolean): void

toggleVoiceControls

  • toggleVoiceControls(state: boolean): void