Global/CreateConVar

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(change default value from 0 to FCVAR_NONE)
 
(One intermediate revision by one user not shown)
Line 27: Line 27:
 
|desc=The help text to show in the console.
 
|desc=The help text to show in the console.
 
|default=""
 
|default=""
 +
}}
 +
{{Arg
 +
|type=number
 +
|name=min
 +
|desc=If set, the convar cannot be changed to a number lower than this value.
 +
 +
{{NextUpdate}}
 +
|default=nil
 +
}}
 +
{{Arg
 +
|type=number
 +
|name=max
 +
|desc=If set, the convar cannot be changed to a number higher than this value.
 +
 +
{{NextUpdate}}
 +
|default=nil
 
}}
 
}}
 
{{Ret
 
{{Ret

Latest revision as of 15:28, 11 October 2019

 CreateConVar( )

Contents

Description

Creates a console variable (ConVar), in general these are for things like gamemode/server settings.

Arguments

string name

Name of the convar.

This cannot be a name of an engine console command or console variable. It will silently fail if it is. If it is the same name as another lua ConVar, it will return that ConVar object.

Arguments

string value

Default value of the convar. Can also be a number.

Arguments

number flags=FCVAR_NONE

Flags of the convar, see FCVAR_ Enums, either as bitflag or as table.

Arguments

string helptext=""

The help text to show in the console.

Arguments

number min=nil

If set, the convar cannot be changed to a number lower than this value.


Next Update Change

This feature is only available in the next update.

Arguments

number max=nil

If set, the convar cannot be changed to a number higher than this value.


Next Update Change

This feature is only available in the next update.

Returns

ConVar

The convar created.
Personal tools
Navigation