Garry's Mod Wiki

DMenu:AddCVar

Panel DMenu:AddCVar( string strText, string convar, string on, string off, function funcFunction = nil )

Description

Creates a DMenuOptionCVar and adds it as an option into the menu. Checking and unchecking the option will alter the given console variable's value.

Arguments

1 string strText
The text of the button
2 string convar
The console variable to change
3 string on
The value of the console variable to set when the option is checked
4 string off
The value of the console variable to set when the option is unchecked
5 function funcFunction = nil
If set, the function will be called every time the option is pressed/clicked/selected.

It will have only one argument: Panel pnl - The created DMenuOptionCVar

Returns

1 Panel
The created DMenuOptionCVar

Page Links


Special Pages


Wikis

?

Render Time: 44ms

DB GetPage 3
Generate Html 17
SaveChanges (1) 10
Render Body 0
Render Sidebar 12