Global/CreateClientConVar

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
Line 9: Line 9:
 
|type=string
 
|type=string
 
|name=name
 
|name=name
|desc=Name of the ConVar to be created and able to be accessed.
+
|desc=Name of the ConVar to be created and able to be accessed.<br><br>
  
 
This cannot be a name of existing console command or console variable. It will silently fail if it is.
 
This cannot be a name of existing console command or console variable. It will silently fail if it is.

Revision as of 12:51, 27 January 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