G.GetConVarString
From GMod Wiki
| 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: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.GetConVarString]G.GetConVarString [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Prints the host name to the console |
|---|---|
| Used on | |
| Code | Msg( "The host name is " .. GetConVarString("hostname") .. "\n") |
| Output | The host name is Garry's Mod |
| Description | Displays a Welcome Message in the Chat |
|---|---|
| Used on | |
| Code | chat.AddText(Color(255,255,255), "Welcome to ", Color(30,255,30), GetConVarString("hostname")) |
| Output | Welcome to <Server Name in green> |