cvars package

Module contents

Provides access to ConVar instances and the ability to create a ConVar.

class cvars.ConVar

Bases: _commands.ConCommandBase, _cvars._IConVar

__init__((object)arg1, (str)name[, (str)value=''[, (str)description=''[, (Channel)flags=0[, (object)min_value=None[, (object)max_value=None]]]]]) → object :

Called when a server-var is initilized.

If the ConVar already exists, all other parameters except name are inconsequential.

Parameters:
  • name (str) – The name of the ConVar.
  • value (str) – The initial value of the ConVar if it doesn’t already exist.
  • description (str) – The description of the ConVar.
  • flags (ConVarFlags) – The initial flags of the ConVar if it doesn’t already exist.
  • min_value (float) – The minimum value allowed for the ConVar.
  • max_value (float) – The maximum value allowed for the ConVar.
get_bool((ConVar)arg1) → bool :

Returns the value as a bool.

get_float((ConVar)arg1) → float :

Returns the value as a float.

get_int((ConVar)arg1) → int :

Returns the value as an int.

get_string((ConVar)arg1) → str :

Returns the value as a string.

has_max((ConVar)arg1) → bool :

Returns wether the ConVar has a maximum value.

has_min((ConVar)arg1) → bool :

Returns wether the ConVar has a minimum value.

make_public((ConVar)arg1) → None :

Set the notify flag and makes the cvar public.

remove_public((ConVar)arg1) → None :

Remove the notify flag and makes the cvar no longer public.

revert((ConVar)arg1) → None :

Resets to default value.

set_bool((ConVar)arg1, (bool)value) → None :

Sets a bool value.

default

Returns the default value.

max

Returns the maximum value.

min

Returns the minimum value.