Class CEntityInstance
- Namespace
- CounterStrikeSharp.API.Core
- Assembly
- CounterStrikeSharp.API.dll
public class CEntityInstance : NativeEntity, IEquatable<CEntityInstance>
- Inheritance
-
objectCEntityInstance
- 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
DesignerName
public string DesignerName { get; }
Property Value
Entity
[SchemaMember("CEntityInstance", "m_pEntity")]
public CEntityIdentity? Entity { get; }
Property Value
EntityIndex
[Obsolete("Use Index instead", true)]
public CEntityIndex? EntityIndex { get; }
Property Value
Index
public uint Index { get; }
Property Value
IsValid
Checks that the entity handle is valid and the handle points to a valid entity
public bool IsValid { get; }
Property Value
PrivateVScripts
[SchemaMember("CEntityInstance", "m_iszPrivateVScripts")]
public string PrivateVScripts { get; set; }
Property Value
VisibleinPVS
[SchemaMember("CEntityInstance", "m_bVisibleinPVS")]
public ref bool VisibleinPVS { get; }
Property Value
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
stringInput action name
activator
CEntityInstanceEntity which initiated the action, null for no entity
caller
CEntityInstanceEntity that is sending the event, null for no entity
value
stringString variant value to send with the event
outputId
intUnknown, 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
stringInput action name
activator
CEntityInstanceEntity which initiated the action, null for no entity
caller
CEntityInstanceEntity that is sending the event, null for no entity
value
stringString variant value to send with the event
delay
floatDelay in seconds before calling the input
outputId
intUnknown, 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
CEntityInstanceAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
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
CEntityInstanceright
CEntityInstance
Returns
operator !=(CEntityInstance?, CEntityInstance?)
public static bool operator !=(CEntityInstance? left, CEntityInstance? right)
Parameters
left
CEntityInstanceright
CEntityInstance