Class ConVar
- Namespace
- CounterStrikeSharp.API.Modules.Cvars
- Assembly
- CounterStrikeSharp.API.dll
public class ConVar
- Inheritance
-
objectConVar
Constructors
ConVar(nint)
public ConVar(nint handle)
Parameters
handle
nint
Properties
Description
public string Description { get; }
Property Value
Flags
The ConVar flags as defined by ConVarFlags.
public ref ConVarFlags Flags { get; }
Property Value
Handle
public nint Handle { get; }
Property Value
Name
public string Name { get; }
Property Value
Public
Shorthand for checking the FCVAR_NOTIFY flag.
public bool Public { get; set; }
Property Value
StringValue
String value of the ConVar.
public string StringValue { get; set; }
Property Value
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
Methods
Find(string)
Finds a ConVar by name.
public static ConVar? Find(string name)
Parameters
name
string
Returns
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>()
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.