Skip to content

ConVar

Fields

This class has no fields.


Enums

e_cvar_flags

Name Value Description
unregistered - If this is set, don't add to linked list, etc.
developmentonly - Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
gamedll - Defined by the game DLL
clientdll - Defined by the client DLL
hidden - Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out.
protected - It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
sponly - This cvar cannot be changed by clients connected to a multiplayer server.
archive - Set to cause it to be saved to vars.rc
notify - Notifies players when changed
userinfo - Changes the client's info string
printableonly - This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
gamedll_for_remote_clients - When on concommands this allows remote clients to execute this cmd on the server.
unlogged - If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
never_as_string - Never try to print that cvar
replicated - Server setting enforced on clients
cheat - Only useable in singleplayer / debug / multiplayer & sv_cheats
ss - Causes varnameN where N == 2 through max splitscreen slots for mod to be autogenerated
demo - Record this cvar when starting a demo file
dontrecord - Don't record these command in demofiles
ss_added - This is one of the "added" FCVAR_SS variables for the splitscreen players
release - CVars tagged with this are the only cvars avaliable to customers
reload_materials - If this cvar changes, it forces a material reload
reload_textures - If this cvar changes, if forces a texture reload
not_connected - CVar cannot be changed by a client that is connected to a server
material_system_thread - Indicates this cvar is read from the material system thread
server_can_execute -
server_cannot_query -
clientcmd_can_execute - IVEngineClient::ClientCmd is allowed to execute this command.
accessible_from_threads - Used as a debugging tool necessary to check material system thread convars

Functions

GetName

This function has no parameters.

Return value

Name Type Description
value string ConVar name
local name = cvar:GetName()

GetHelpText

This function has no parameters.

Return value

Name Type Description
value string ConVar description
local desc = cvar:GetHelpText()

IsRegistered

This function has no parameters.

Return value

Name Type Description
value bool -
local is_registered = cvar:IsRegistered()

IsFlagSet

Name Type Description
flags int -

Return value

Name Type Description
value bool -
local flag_exist = cvar:IsFlagSet(bit.lshift(1, 4)) -- hidden

AddFlags

Name Type Description
flags int -
cvar:AddFlags(bit.lshift(1, 4)) -- hidden

RemoveFlags

Name Type Description
value int -
cvar:RemoveFlags(bit.lshift(1, 4)) -- hidden

GetFlags

This function has no parameters.

Return value

Name Type Description
value int Command flags
local flags = cvar:GetFlags()

Dispatch

Executes a ConCommand callback, passing its arguments to it

Name Type Description
... any Arguments passed to the callback
object:invoke_callback(...)

GetBool

This function has no parameters.

Return value

Name Type Description
value bool ConVar value as a bool
local bool_value = cvar:GetBool()

GetInt

This function has no parameters.

Return value

Name Type Description
value int ConVar value as a int
local int_value = cvar:GetInt()

GetFloat

This function has no parameters.

Return value

Name Type Description
value float ConVar value as a float
local float_value = cvar:GetFloat()

GetString

This function has no parameters.

Return value

Name Type Description
value string ConVar value as a string
local string_value = cvar:GetString()

GetFloat

This function has no parameters.

Return value

Name Type Description
value Color ConVar value as a color
local clr_value = cvar:Color()

SetInt

Name Type Description
value bool New convar's value
cvar:SetBool(false)

SetInt

Name Type Description
value int New convar's value
cvar:SetInt(1)

SetFloat

Name Type Description
value float New convar's value
cvar:SetFloat(0.5)

GetInt

Name Type Description
value string New convar's value
cvar:SetString("Hello world, it's me")

SetFloat

Name Type Description
value Color New convar's value
cvar:SetColor(Color.new(1.0, 1.0, 1.0, 1.0))