CreateConVar

Last Updated2014-12-10
Created At2014-12-10

Creates a new console variable.

native ConVar CreateConVar(const char[] name, const char[] defaultValue, const char[] description = "", int flags = 0, bool hasMin = false, float min = 0.000000, bool hasMax = false, float max = 0.000000)

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

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

Error

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