Garry's Mod Wiki

Garry's Mod Wiki

  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.
Function argument(s):
1 Panel pnl - The DMenuOptionCVar that was clicked.

Returns

1 Panel
The created DMenuOptionCVar

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...