CreateClientConVar

From Garry's Mod
Jump to: navigation, search
 CreateClientConVar( )

Contents

Description

Makes a clientside-only console variable

NOTE This function is a wrapper of CreateConVar, with the difference being that FCVAR_ARCHIVE and FCVAR_USERINFO are added automatically when setting the last two arguments to true.

Although this function is shared, it should only be used clientside.

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

string 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.

Arguments

string helptext=""

Help text to display in the console.

Returns

ConVar

Created convar.

Examples

Example

Creates a ConVar that does nothing and saves.

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


Personal tools
Navigation