Global/CreateClientConVar

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Fixed CreateClientConVar example from sending in wrong data type)
Line 1: Line 1:
 
{{Func
 
{{Func
|Name=CreateClientConVar
 
|Parent=Global
 
 
|Description=Makes a clientside-only console variable
 
|Description=Makes a clientside-only console variable
 
|Realm=Client
 
|Realm=Client
 
|IsClass=No
 
|IsClass=No
 +
|Name=CreateClientConVar
 +
|Parent=Global
 
}}
 
}}
 
{{Arg
 
{{Arg
Line 36: Line 36:
 
{{Example
 
{{Example
 
|Description=Creates a ConVar that does nothing and saves.
 
|Description=Creates a ConVar that does nothing and saves.
|Code=CreateClientConVar("superspeed_enabled", "0", true, false)
+
|Code=CreateClientConVar("superspeed_enabled", 0, true, false)
 
}}
 
}}

Revision as of 22:21, 10 June 2015

 CreateClientConVar( )

Contents

Description

Makes a clientside-only console variable

Arguments

string name

Name of the ConVar to be created and able to be accessed.

This cannot be a name of existing console command or console variable. It will silently fail if it is.

Arguments

number default

Default value of the ConVar.

Arguments

boolean shouldsave=true

Should the ConVar be saved across sessions

Arguments

boolean userdata=false

Should the ConVar and its containing data be sent to the server when it has changed. This make the convar accessible from server using Player:GetInfoNum and similar functions.

Returns

ConVar

Created convar.

Examples

Example

Creates a ConVar that does nothing and saves.

CreateClientConVar("superspeed_enabled", 0, true, false)


Personal tools
Navigation