CreateConVar Function

Creates a new console variable.

ConVar CreateConVar(const char[] name, const char[] defaultValue, const char[] description, int flags, bool hasMin, float min, bool hasMax, float max)

Parameters

const char[] name

Name of new convar.

const char[] defaultValue

String containing the default value of new convar.

const char[] description

Optional description of the convar.

int flags

Optional bitstring of flags determining how the convar should be handled. See FCVAR_* constants for more details.

bool hasMin

Optional boolean that determines if the convar has a minimum value.

float min

Minimum floating point value that the convar can have if hasMin is true.

bool hasMax

Optional boolean that determines if the convar has a maximum value.

float max

Maximum floating point value that the convar can have if hasMax is true.

Return Value

A handle to the newly created convar. If the convar already exists, a handle to it will still be returned.

Errors

Convar name is blank or is the same as an existing console command.