Toggle: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(create)
 
Line 11: Line 11:
Cycle values
Cycle values
   toggle viewmodel_fov 54 57 59 65 71 98
   toggle viewmodel_fov 54 57 59 65 71 98
 
==See also==
 
*{{ent|BindToggle}}
*{{ent|setinfo}}
[[Category:Console Commands]]
[[Category:Console Commands]]

Revision as of 14:03, 22 October 2021

Toggle a cvar toggle it on or off, or cycle it between a set of values.

Syntax

 toggle CVAR VALUE1 VALUE2 VALUE3 ... VALUEN

"Toggling" past the last argument will loop around, i.e. cause the cvar to be set VALUE1 once again. Repeating the last value will prevent looping.

Examples

If values are omitted cvar is toggled between 0 and 1

 toggle cl_showpos

Toggle 0 to 4 and stop at 4

 toggle cl_showfps 0 1 2 3 4 4

Cycle values

 toggle viewmodel_fov 54 57 59 65 71 98

See also