Cvar

csgo.interface_handler:get_cvar( )

Functions

find_var

returns a csgo.cvar value

cvar:find_var( var_name )

Parameter

Data type

Description

var_name

string

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

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)

Last updated