Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!

cvar set

From Quake Wiki

Revision as of 17:42, 1 August 2023 by Boondorl (talk | contribs) (Created page with "''void'' '''cvar_set'''(''string'' name, ''string'' val) == Usage == Sets the value of a console variable. All variables are stored as strings internally so this can be used...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

void cvar_set(string name, string val)

Usage[edit]

Sets the value of a console variable. All variables are stored as strings internally so this can be used to change any variable.

Parameters[edit]

  • name
The name of the console variable.
  • val
The value to set it to.

Example[edit]

// Change the map's gravity based off which one it is
if (self.model == "maps/e1m8.bsp")
    cvar_set("sv_gravity", "100");
else
    cvar_set("sv_gravity", "800");