Table of Contents

Class ScriptContext

Namespace
CounterStrikeSharp.API.Core
Assembly
CounterStrikeSharp.API.dll
public class ScriptContext
Inheritance
object
ScriptContext

Constructors

ScriptContext()

public ScriptContext()

ScriptContext(fxScriptContext*)

public ScriptContext(fxScriptContext* context)

Parameters

context fxScriptContext*

Properties

GlobalScriptContext

public static ScriptContext GlobalScriptContext { get; }

Property Value

ScriptContext

Methods

CheckErrors()

public void CheckErrors()

GetArgument(Type, int)

public object GetArgument(Type type, int index)

Parameters

type Type
index int

Returns

object

GetArgument<T>(int)

public T GetArgument<T>(int index)

Parameters

index int

Returns

T

Type Parameters

T

GetBytes()

public byte[] GetBytes()

Returns

byte[]

GetContextUnderlyingAddress()

public nint GetContextUnderlyingAddress()

Returns

nint

GetResult(Type)

public object GetResult(Type type)

Parameters

type Type

Returns

object

GetResultNativeObject<T>()

Reads a pointer result from the context and creates a NativeObject-derived instance using FastGenericNew. Avoids Activator.CreateInstance overhead.

public T GetResultNativeObject<T>()

Returns

T

Type Parameters

T

GetResultPrimitive<T>()

Reads a primitive/unmanaged result directly from the context's result buffer without Marshal.PtrToStructure or boxing overhead.

public T GetResultPrimitive<T>() where T : unmanaged

Returns

T

Type Parameters

T

GetResult<T>()

public T GetResult<T>()

Returns

T

Type Parameters

T

Invoke()

public void Invoke()

Push(object)

public void Push(object arg)

Parameters

arg object

PushPrimitive<T>(T)

Pushes a primitive/unmanaged value directly into the context's function data buffer without boxing or Marshal.StructureToPtr overhead.

public void PushPrimitive<T>(T value) where T : unmanaged

Parameters

value T

Type Parameters

T

Reset()

public void Reset()

SetIdentifier(ulong)

[SecurityCritical]
public void SetIdentifier(ulong arg)

Parameters

arg ulong

SetResult(object, fxScriptContext*)

public void SetResult(object arg, fxScriptContext* cxt)

Parameters

arg object
cxt fxScriptContext*

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.