GetConsoleVarAsBool

GetConsoleVarAsBool

Description:
Function GetConsoleVarAsBool get the boolean value of a console variable.
Type 'varlist' in the server console to display a list of available console variables and their types.


Parameters:
(varname[])
{[string {{{2}}} {{{3}}}

|varname|The name of the boolean variable to get the value of.}}


Return Values:
The value of the specified console variable. 0 if the specified console variable is not a boolean or doesn't exist.


Examples:
public OnGameModeInit()
{
    new queryEnabled = GetConsoleVarAsBool("query");
    if(!queryEnabled)
    {
        print("WARNING: Querying is disabled. The server will appear offline in the server browser.");
    }
    return 1;
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.