Neverlose
  • Welcome
  • Official Website
  • Useful information
    • 📲Quick start
    • â›Šī¸Common knowledge
    • 🧠Examples
      • âš™ī¸Materials
      • âš™ī¸Color
      • âš™ī¸Vector
      • âš™ī¸ESP
      • âš™ī¸ConVars
      • âš™ī¸UI
  • Documentation
    • 📓Events
    • âš™ī¸Variables
      • 🌎_G
      • đŸ—„ī¸bit
      • 🌈color
      • ⌚common
      • 🎲cvar
      • 💾db
      • 👾entity
      • 👩‍đŸ’ģesp
      • đŸ—ŗī¸events
      • 📂files
      • 📎globals
      • 🔓json
      • ✨materials
      • đŸ”ĸmath
      • đŸ’ģui
      • â˜ī¸network
      • 🌃panorama
      • đŸ’ĸrage
      • 🎨render
      • 🧰utils
      • 📍vector
Powered by GitBook
On this page
  • Example
  • Functions:
  • :call
  • :int
  • :float
  • :string
  • :set_callback
  • :unset_callback
  1. Documentation
  2. Variables

cvar

Example

cvar.mp_teammates_are_enemies:int(1)
cvar.clear:call()

Functions:

:call

cvar_object:call(...)

Name
Type
Description

...

Arguments passed to the callback

Executes a ConCommand or cvar callback, passing its arguments to it.

:int

cvar_object:int(): number

cvar_object:int(value: number[, raw: boolean ])

Name
Type
Description

value

number

New int value

raw

boolean

Optional. If true then the raw value will be set

Gets or sets the ConVar int value.

:float

cvar_object:float(): number

cvar_object:float(value: number[, raw: boolean ])

Name
Type
Description

value

number

New float value

raw

boolean

Optional. If true then the raw value will be set

Gets or sets the ConVar float value.

:string

cvar_object:string([ value: any ]): string

Name
Type
Description

value

any

New string value. If not specified then returns the string value of the ConVar

Gets or sets the ConVar string value.

:set_callback

You can access the cvar_object, old_value and new_value by adding them to the function arguments.

You can access the cvar_object and args by adding them to the function arguments. Inside the callback, return false to prevent the command from being executed.

cvar_object:set_callback(callback: function)

Name
Type
Description

callback

function

Lua function to call

Registers the callback to the specified ConVar/Command. The registered function will be called every time the specified convar value is updated.

:unset_callback

cvar_object:unset_callback(callback: function)

Name
Type
Description

callback

function

Lua function that was passed to the :set_callback function

Unregisters the callback that was set via the :set_callback function from the specified ConVar/Command.

PreviouscommonNextdb

Last updated 2 years ago

âš™ī¸
🎲