Player/GetInfo

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Added a note about the max length)
Line 1: Line 1:
 
{{Func
 
{{Func
 
|Description=Retrieves the value of a client-side {{Type|ConVar}}. The {{Type|ConVar}} must have a [[Enums/FCVAR|FCVAR_USERINFO]] flag for this to work.
 
|Description=Retrieves the value of a client-side {{Type|ConVar}}. The {{Type|ConVar}} must have a [[Enums/FCVAR|FCVAR_USERINFO]] flag for this to work.
 +
 +
{{Note|The returned value is truncated to 31 bytes.}}
 
|Realm=Server
 
|Realm=Server
 
|IsClass=Yes
 
|IsClass=Yes

Revision as of 03:16, 10 December 2017

 Player:GetInfo( )

Contents

Description

Retrieves the value of a client-side ConVar. The ConVar must have a FCVAR_USERINFO flag for this to work.

NOTE

The returned value is truncated to 31 bytes.

Arguments

string cVarName

The name of the client-side ConVar

Returns

string

The value of the ConVar

Examples

Example

Creates clientside ConVar 'Apple' and retrieves value of it.

if CLIENT then
	CreateConVar( "Apple", "ILikeApples", FCVAR_USERINFO )
else
	MsgN( Entity( 1 ):GetInfo( "Apple" ) )
end

Output:

ILikeApples
Personal tools
Navigation