Legacy Lua Api
  • Overview
  • Getting Started
    • Creating Scripts
    • Coding Scripts
    • Examples
  • Fatality
    • Render
    • Config
    • Menu
    • Callbacks
    • Math
    • Input
    • Datatypes
      • Shot
      • Lag Record
      • Shot Info
      • Config Value
  • Csgo
    • Interface Handler
      • Global Vars
      • Entity List
      • Engine Client
      • Cvar
      • Events
      • Debug Overlay
    • Datatypes
      • Color
      • Vector3
      • Vector2
      • Angle
      • Entity
      • Player
      • Cvar
      • Game Event
      • Font
      • Matrix3x4
Powered by GitBook

© 2025 - FATALITY

On this page
  • Functions
  • find_var
  • print_console
  • print_dev_console
  • Example
  1. Csgo
  2. Interface Handler

Cvar

csgo.interface_handler:get_cvar( )

PreviousEngine ClientNextEvents

Last updated 2 years ago

Functions

find_var

returns a value

cvar:find_var( var_name )

Parameter

Data type

Description

var_name

string

print_console

prints text to the console

cvar:print_console( text, color )

Parameter

Data type

Description

text

string

the text to be printed

color

color of text

print_dev_console

prints text to the developer console at the top left of the screen

cvar:print_dev_console( text )

Parameter

Data type

Description

text

string

the text to be printed

Example

-- Get the cvar interface
local Cvar = csgo.interface_handler:get_cvar()

-- Get the convar we want
local ConvarName = "cl_righthand"
local Convar = Cvar:find_var(ConvarName)

-- Check if the we found the convar (nil if not found)
if not Convar then
    return
end

-- Print the name and value to the console
print(string.format("%s = %i", ConvarName, Convar:get_int()))

-- Set our value to 0
Convar:set_int(0)

csgo.cvar
name of console variable
csgo.color