Skip to content

IConsole

cs_script API / IConsole

interface in cs_script/point_script — the type of Console.

An API provided to scripts for the console: logging, ConVars, and ConCommands.
Access these functions by importing Console from "cs_script/point_script".

    CS2 build 27045800 · Steam date 2026-11-30 · platform windows-x86_64 · schema format 2.2

    Members

    Log

    Log(text: any): void

    Log a message to the console.

    GetConvarBoolean

    GetConvarBoolean(name: string): boolean | undefined

    Get the value of a boolean convar.

    See also: ConVars.

    GetConvarNumber

    GetConvarNumber(name: string): number | undefined

    Get the value of a numeric convar.

    See also: ConVars.

    GetConvarString

    GetConvarString(name: string): string | undefined

    Get the value of any convar, converted to a string.

    See also: ConVars.

    GetConvarVector

    GetConvarVector(name: string): Vector | undefined

    Get the value of a Vector convar.

    See also: ConVars.

    GetConvarQAngle

    GetConvarQAngle(name: string): QAngle | undefined

    Get the value of a QAngle convar.

    See also: ConVars.

    GetConvarColor

    GetConvarColor(name: string): Color | undefined

    Get the value of a Color convar.

    See also: ConVars.

    SetConvar

    SetConvar(name: string, value: boolean | number | string | Vector | QAngle | ColorArg): void

    Set the value of a convar.

    See also: ConVars.

    ClientCommand

    ClientCommand(playerSlot: number, command: string): void

    Issue the specified command to the specified client.

    See also: Commands.

    ServerCommand

    ServerCommand(command: string): void

    Issue a command.

    See also: Commands, ConVars.

    RegisterCheatCommand

    RegisterCheatCommand(name: string, callback: (args: string) => void): void

    Creates a console command that will run the specified callback. The command will only work when sv_cheats is true.