Garry's Mod Wiki


number Player:GetInfoNum( string cVarName, number default )


Retrieves the numeric value of a client-side convar, returns nil if value is not convertible to a number. The ConVar must have a FCVAR_USERINFO flag for this to work.


1 string cVarName
The name of the ConVar to query the value of
2 number default
Default value if we failed to retrieve the number.


1 number
The value of the ConVar or the default value


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

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


Shows difference between Player:GetInfo and Player:GetInfoNum.

if CLIENT then CreateConVar( "Apple", "1", FCVAR_USERINFO ) else MsgN( type( Entity( 1 ):GetInfoNum( "Apple", 1 ) ) ) MsgN( type( Entity( 1 ):GetInfo( "Apple" ) ) ) end
Output: number string

Page Links

Special Pages



Render Time: 48ms

DB GetPage 5
Generate Html 20
SaveChanges (1) 8
Render Body 0
Render Sidebar 12