Garry's Mod Wiki

ConVar:GetString

  string ConVar:GetString()

Description

Returns the current ConVar value as a string.

Returns

1 string
The current console variable value as a string.

Example

Will check if the gamemode is sandbox (Consider using engine.ActiveGamemode)

if GetConVar("gamemode"):GetString() == "sandbox" then print("Gamemode is sandbox") end
Output: Gamemode is sandbox