Player/GetInfo

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Added a note about the max length)
m (more of a warning, really)
 
Line 2: Line 2:
 
|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.}}
+
{{Warning|The returned value is truncated to 31 bytes.}}
 
|Realm=Server
 
|Realm=Server
 
|IsClass=Yes
 
|IsClass=Yes

Latest revision as of 04:44, 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.

WARNING

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