Garry's Mod Wiki

Revision Difference

Player:GetInfo#512731

<function name="GetInfo" parent="Player" type="classfunc">⤶ <description>⤶ Retrieves the value of a client-side <page>ConVar</page>. The <page>ConVar</page> must have a [FCVAR_USERINFO](/gmod/Enums/FCVAR) flag for this to work.⤶ ⤶ <warning>The returned value is truncated to 31 bytes.</warning>⤶ </description>⤶ <realm>Server</realm>⤶ <args>⤶ <arg name="cVarName" type="string">The name of the client-side &lt;page&gt;ConVar&lt;/page&gt;</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="string">The value of the <page>ConVar</page></ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Creates clientside <page>ConVar</page> 'Apple' and retrieves value of it.</description>⤶ <code>⤶ if CLIENT then⤶ CreateConVar( "Apple", "ILikeApples", FCVAR_USERINFO )⤶ else⤶ MsgN( Entity( 1 ):GetInfo( "Apple" ) )⤶ end⤶ </code>⤶ <outputfixedwidth>Fixed width</outputfixedwidth>⤶ <output>ILikeApples</output>⤶ ⤶ </example>