Table of Contents

Class ConVar

Namespace
CounterStrikeSharp.API.Modules.Cvars
Assembly
CounterStrikeSharp.API.dll
public class ConVar
Inheritance
ConVar

Constructors

ConVar(nint)

public ConVar(nint handle)

Parameters

handle nint

Properties

Description

public string Description { get; }

Property Value

string

Flags

The ConVar flags as defined by ConVarFlags.

public ref ConVarFlags Flags { get; }

Property Value

ConVarFlags

Handle

public nint Handle { get; }

Property Value

nint

Name

public string Name { get; }

Property Value

string

Public

Shorthand for checking the FCVAR_NOTIFY flag.

public bool Public { get; set; }

Property Value

bool

StringValue

String value of the ConVar.

public string StringValue { get; set; }

Property Value

string

Remarks

String is a special exception as we have to marshal the string to UTF8 on the send/receive to unmanaged code.

Type

The underlying data type of the ConVar.

public ref ConVarType Type { get; }

Property Value

ConVarType

Methods

Find(string)

Finds a ConVar by name.

public static ConVar? Find(string name)

Parameters

name string

Returns

ConVar

GetNativeValue<T>()

Used to access reference value types, i.e. Vector, QAngle

public T GetNativeValue<T>() where T : NativeObject

Returns

T

Type Parameters

T

GetPrimitiveValue<T>()

Used to access primitive value types, i.e. bool, float, int, etc.

public ref T GetPrimitiveValue<T>()

Returns

T

Type Parameters

T

The type of value to retrieve

SetValue<T>(T)

public void SetValue<T>(T value)

Parameters

value T

Type Parameters

T

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.