Garry's Mod Wiki

Garry's Mod Wiki

  string Player:GetInfo( string cVarName )

Description

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

The returned value is truncated to 31 bytes.
On client this function will return value of the local player, regardless of which player the function was called on!

Arguments

1 string cVarName
The name of the client-side ConVar.

Returns

1 string
The value of the ConVar. Or an empty string if the convar doesn't exist.

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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...