ConVar.GetDefault

From GMod Wiki

Jump to: navigation, search
Function
Syntax ConVar:GetDefault( )
Description:
Retrieves the default value of a ConVar object.
Returns: String Value
In Object: Convar
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=ConVar.GetDefault]ConVar.GetDefault [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis example shows how the GetDefault gets the first value (default) the convar was set to
Used onNewerClient.png
Code
local convar1 = CreateClientConVar("__testconvar_1","DefaultData")
LocalPlayer():ConCommand('__testconvar_1 "string"\n')
Msg("Command 1 Changed to: "..tostring(convar1:GetString()).."\n")
Msg("Command 1 Default: "..tostring(convar1:GetDefault()).."\n")
Output
Command 1 Changed to: string
Command 1 Default: DefaultData


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox