Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "cvar"
From Quake Wiki
m (→Usage) |
|||
Line 2: | Line 2: | ||
== Usage == | == Usage == | ||
− | Gets the value of a console variable as a number. For variables that | + | Gets the value of a console variable as a number. For variables that don't store numbers or don't exist this will always return 0. |
=== Parameters === | === Parameters === |
Latest revision as of 17:43, 1 August 2023
float cvar(string name)
Contents
Usage[edit]
Gets the value of a console variable as a number. For variables that don't store numbers or don't exist this will always return 0.
Parameters[edit]
- name
- The name of the console variable.
Return[edit]
The value of the console variable.
Example[edit]
// Get the current gravity float gravity = cvar("sv_gravity");