GetConVarNumber
Description
Returns the numeric value ConVar (converted from the ConVar's string value) with the specified name.
This function will return 0 if the ConVar does not exist. Use cvars.Number to specify your own default.
Will return the value of game.MaxPlayers if maxplayers is specified as the ConVar name, even though maxplayers is not a ConVar. (it is a console command) You should be using aforementioned Lua function instead for that case.
In performance intensive places such as think and rendering callbacks/hooks, it is advised to use ConVar:GetFloat on a ConVar object directly, which be retrieved via GetConVar, or from existing CreateConVar call.
Arguments
Returns
Page views: 24,830
Updated: This Month
Updated: This Month
Garry's Mod
Rust
Steamworks
Wiki Help