Player:GetInfoNum
Description
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.
Arguments
Returns
Example
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
Example
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