ConVar.GetDefault

From GMod Wiki

Revision as of 19:48, 29 October 2009 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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