G.GetConVarString

From GMod Wiki

Jump to: navigation, search
Function
Syntax GetConVarString( String convar )
Where is this used?
Description:
Returns the value of a specified console-variable.
Returns: String
Part of Library: Global Functions
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=G.GetConVarString]G.GetConVarString [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints the host name to the console
Used onNewerShared.png
Code
Msg( "The host name is " .. GetConVarString("hostname") .. "\n")
OutputThe host name is Garry's Mod


DescriptionDisplays a Welcome Message in the Chat
Used onNewerClient.png
Code
chat.AddText(Color(255,255,255), "Welcome to ", Color(30,255,30), GetConVarString("hostname"))
OutputWelcome to <Server Name in green>
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox