Table of Contents

Class CEntityInstance

Namespace
CounterStrikeSharp.API.Core
Assembly
CounterStrikeSharp.API.dll
public class CEntityInstance : NativeEntity, IEquatable<CEntityInstance>
Inheritance
CEntityInstance
Implements
Derived
Inherited Members

Constructors

CEntityInstance(nint)

public CEntityInstance(nint pointer)

Parameters

pointer nint

CEntityInstance(uint)

public CEntityInstance(uint rawHandle)

Parameters

rawHandle uint

Properties

CScriptComponent

[SchemaMember("CEntityInstance", "m_CScriptComponent")]
public CScriptComponent? CScriptComponent { get; }

Property Value

CScriptComponent

DesignerName

public string DesignerName { get; }

Property Value

string

Entity

[SchemaMember("CEntityInstance", "m_pEntity")]
public CEntityIdentity? Entity { get; }

Property Value

CEntityIdentity

EntityIndex

[Obsolete("Use Index instead", true)]
public CEntityIndex? EntityIndex { get; }

Property Value

CEntityIndex?

Index

public uint Index { get; }

Property Value

uint

IsValid

Checks that the entity handle is valid and the handle points to a valid entity

public bool IsValid { get; }

Property Value

bool

PrivateVScripts

[SchemaMember("CEntityInstance", "m_iszPrivateVScripts")]
public string PrivateVScripts { get; set; }

Property Value

string

VisibleinPVS

[SchemaMember("CEntityInstance", "m_bVisibleinPVS")]
public ref bool VisibleinPVS { get; }

Property Value

bool

Methods

AcceptInput(string, CEntityInstance?, CEntityInstance?, string, int)

Calls a named input method on an entity, this will bypass the map IO event queue system.

entity.AcceptInput("Break");

public void AcceptInput(string inputName, CEntityInstance? activator = null, CEntityInstance? caller = null, string value = "", int outputId = 0)

Parameters

inputName string

Input action name

activator CEntityInstance

Entity which initiated the action, null for no entity

caller CEntityInstance

Entity that is sending the event, null for no entity

value string

String variant value to send with the event

outputId int

Unknown, defaults to 0

Exceptions

InvalidOperationException

Entity is not valid

AddEntityIOEvent(string, CEntityInstance?, CEntityInstance?, string, float, int)

Calls a named input method on an entity, conforming to the map IO event queue system.

entity.AddEntityIOEvent("Break");

public void AddEntityIOEvent(string inputName, CEntityInstance? activator = null, CEntityInstance? caller = null, string value = "", float delay = 0, int outputId = 0)

Parameters

inputName string

Input action name

activator CEntityInstance

Entity which initiated the action, null for no entity

caller CEntityInstance

Entity that is sending the event, null for no entity

value string

String variant value to send with the event

delay float

Delay in seconds before calling the input

outputId int

Unknown, defaults to 0

Exceptions

InvalidOperationException

Entity is not valid

Equals(CEntityInstance?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(CEntityInstance? other)

Parameters

other CEntityInstance

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

Remove()

public void Remove()

Operators

operator ==(CEntityInstance?, CEntityInstance?)

public static bool operator ==(CEntityInstance? left, CEntityInstance? right)

Parameters

left CEntityInstance
right CEntityInstance

Returns

bool

operator !=(CEntityInstance?, CEntityInstance?)

public static bool operator !=(CEntityInstance? left, CEntityInstance? right)

Parameters

left CEntityInstance
right CEntityInstance

Returns

bool