CVar

Show declaration
struct CVar clearScope;

Unserializable — Do not use as a member unless marked as transient

A Console Variable, either defined in CVARINFO or by the engine.

All Get and Set operations will work regardless of the real type of the CVar, as they are not "strongly" typed.

Class Methods

static CVar FindCVar(name n)

Returns a server CVar by name, or null if none is found.

static CVar GetCVar(name n, PlayerInfo player = null)

Returns a user or server CVar by name, with player as the user if applicable, or null if none is found.

Overview of class methods

FindCVar, GetCVar

Instance Methods

Getters

bool GetBool()

double GetFloat()

int GetInt()

string GetString()

Returns a representation of the value of the CVar.

ECVarType GetRealType()

Returns the type of the CVar as it was defined.

Setters

Setters may only be used on mod-defined CVars.

void SetBool(bool v)

void SetFloat(double v)

void SetInt(int v)

void SetString(string v)

Sets the CVar to v.

int ResetToDefault()

Resets the CVar to its default value and returns 0. The purpose of the return is unknown.

Overview of instance methods

GetBool, GetFloat, GetInt, GetRealType, GetString, ResetToDefault, SetBool, SetFloat, SetInt, SetString