Table of Contents

Interface IOmpEntityProvider

Namespace
SampSharp.Entities.SAMP
Assembly
SampSharp.OpenMp.Entities.dll

Provides methods for getting ECS entities/components for open.mp entities. For entities created through SampSharp.Entities, the existing entities and components are returned. For foreign entities (entities created through other scripts or open.mp components) new ECS entities and components are created and returned where possible.

public interface IOmpEntityProvider

Methods

GetActor(int)

Gets the actor with the specified identifier.

Actor? GetActor(int id)

Parameters

id int

The identifier of the actor.

Returns

Actor

The actor with the specified identifier or null if no actor could be found.

GetComponent(IActor)

Gets the component for the specified actor.

Actor? GetComponent(IActor actor)

Parameters

actor IActor

The actor to get the component for.

Returns

Actor

The actor component.

GetComponent(IClass)

Gets the component for the specified player class.

Class? GetComponent(IClass playerClass)

Parameters

playerClass IClass

The player class to get the component for.

Returns

Class

The player class component.

GetComponent(IGangZone)

Gets the component for the specified gang zone.

BaseGangZone? GetComponent(IGangZone gangZone)

Parameters

gangZone IGangZone

The gang zone to get the component for.

Returns

BaseGangZone

The gang zone component.

GetComponent(IMenu)

Gets the component for the specified menu.

Menu? GetComponent(IMenu menu)

Parameters

menu IMenu

The menu to get the component for.

Returns

Menu

The menu component.

GetComponent(INPC)

Gets the component for the specified NPC.

Npc? GetComponent(INPC npc)

Parameters

npc INPC

The NPC to get the component for.

Returns

Npc

The NPC component.

GetComponent(IObject)

Gets the component for the specified object.

GlobalObject? GetComponent(IObject @object)

Parameters

object IObject

The object to get the component for.

Returns

GlobalObject

The object component.

GetComponent(IPickup)

Gets the component for the specified pickup.

BasePickup? GetComponent(IPickup pickup)

Parameters

pickup IPickup

The pickup to get the component for.

Returns

BasePickup

The pickup component.

GetComponent(IPlayer)

Gets the component for the specified player.

Player? GetComponent(IPlayer player)

Parameters

player IPlayer

The player to get the component for.

Returns

Player

The player component.

GetComponent(IPlayerObject, IPlayer)

Gets the component for the specified player object.

PlayerObject? GetComponent(IPlayerObject playerObject, IPlayer player = default)

Parameters

playerObject IPlayerObject

The player object to get the component for.

player IPlayer

The owner of the player object.

Returns

PlayerObject

The player object component.

GetComponent(IPlayerTextDraw, IPlayer)

Gets the component for the specified player text draw.

PlayerTextDraw? GetComponent(IPlayerTextDraw playerTextDraw, IPlayer player = default)

Parameters

playerTextDraw IPlayerTextDraw

The player text draw to get the component for.

player IPlayer

The owner of the player text draw.

Returns

PlayerTextDraw

The player text draw component.

GetComponent(IPlayerTextLabel, IPlayer)

Gets the component for the specified player text label.

PlayerTextLabel? GetComponent(IPlayerTextLabel playerTextLabel, IPlayer player = default)

Parameters

playerTextLabel IPlayerTextLabel

The player text label to get the component for.

player IPlayer

The owner of the player text label.

Returns

PlayerTextLabel

The player text label component.

GetComponent(ITextDraw)

Gets the component for the specified text draw.

TextDraw? GetComponent(ITextDraw textDraw)

Parameters

textDraw ITextDraw

The text draw to get the component for.

Returns

TextDraw

The text draw component.

GetComponent(ITextLabel)

Gets the component for the specified text label.

TextLabel? GetComponent(ITextLabel textLabel)

Parameters

textLabel ITextLabel

The text label to get the component for.

Returns

TextLabel

The text label component.

GetComponent(IVehicle)

Gets the component for the specified vehicle.

Vehicle? GetComponent(IVehicle vehicle)

Parameters

vehicle IVehicle

The vehicle to get the component for.

Returns

Vehicle

The vehicle component.

GetEntity(IActor)

Gets the entity for the specified actor.

EntityId GetEntity(IActor actor)

Parameters

actor IActor

The actor to get the entity for.

Returns

EntityId

The actor entity.

GetEntity(IClass)

Gets the entity for the specified player class.

EntityId GetEntity(IClass playerClass)

Parameters

playerClass IClass

The player class to get the entity for.

Returns

EntityId

The player class entity.

GetEntity(IGangZone)

Gets the entity for the specified gang zone.

EntityId GetEntity(IGangZone gangZone)

Parameters

gangZone IGangZone

The gang zone to get the entity for.

Returns

EntityId

The gang zone entity.

GetEntity(IMenu)

Gets the entity for the specified menu.

EntityId GetEntity(IMenu menu)

Parameters

menu IMenu

The menu to get the entity for.

Returns

EntityId

The menu entity.

GetEntity(INPC)

Gets the entity for the specified NPC.

EntityId GetEntity(INPC npc)

Parameters

npc INPC

The NPC to get the entity for.

Returns

EntityId

The NPC entity.

GetEntity(IObject)

Gets the entity for the specified object.

EntityId GetEntity(IObject @object)

Parameters

object IObject

The object to get the entity for.

Returns

EntityId

The object entity.

GetEntity(IPickup)

Gets the entity for the specified pickup.

EntityId GetEntity(IPickup pickup)

Parameters

pickup IPickup

The pickup to get the entity for.

Returns

EntityId

The pickup entity.

GetEntity(IPlayer)

Gets the entity for the specified player.

EntityId GetEntity(IPlayer player)

Parameters

player IPlayer

The player to get the entity for.

Returns

EntityId

The player entity.

GetEntity(IPlayerObject, IPlayer)

Gets the entity for the specified player object.

EntityId GetEntity(IPlayerObject playerObject, IPlayer player = default)

Parameters

playerObject IPlayerObject

The player object to get the entity for.

player IPlayer

The owner of the player object.

Returns

EntityId

The player object entity.

GetEntity(IPlayerTextDraw, IPlayer)

Gets the entity for the specified player text draw.

EntityId GetEntity(IPlayerTextDraw playerTextDraw, IPlayer player = default)

Parameters

playerTextDraw IPlayerTextDraw

The player text draw to get the entity for.

player IPlayer

The owner of the player text draw.

Returns

EntityId

The player text draw entity.

GetEntity(IPlayerTextLabel, IPlayer)

Gets the entity for the specified player text label.

EntityId GetEntity(IPlayerTextLabel playerTextLabel, IPlayer player = default)

Parameters

playerTextLabel IPlayerTextLabel

The player text label to get the entity for.

player IPlayer

The owner of the player text label.

Returns

EntityId

The player text label entity.

GetEntity(ITextDraw)

Gets the entity for the specified text draw.

EntityId GetEntity(ITextDraw textDraw)

Parameters

textDraw ITextDraw

The text draw to get the entity for.

Returns

EntityId

The text draw entity.

GetEntity(ITextLabel)

Gets the entity for the specified text label.

EntityId GetEntity(ITextLabel textLabel)

Parameters

textLabel ITextLabel

The text label to get the entity for.

Returns

EntityId

The text label entity.

GetEntity(IVehicle)

Gets the entity for the specified vehicle.

EntityId GetEntity(IVehicle vehicle)

Parameters

vehicle IVehicle

The vehicle to get the entity for.

Returns

EntityId

The vehicle entity.

GetGangZone(int)

Gets the gang zone with the specified identifier.

BaseGangZone? GetGangZone(int id)

Parameters

id int

The identifier of the gang zone.

Returns

BaseGangZone

The gang zone with the specified identifier or null if no gang zone could be found.

GetMenu(int)

Gets the menu with the specified identifier.

Menu? GetMenu(int id)

Parameters

id int

The identifier of the menu.

Returns

Menu

The menu with the specified identifier or null if no menu could be found.

GetNpc(int)

Gets the NPC with the specified identifier.

Npc? GetNpc(int id)

Parameters

id int

The identifier of the NPC.

Returns

Npc

The NPC with the specified identifier or null if no NPC could be found.

GetObject(int)

Gets the object with the specified identifier.

GlobalObject? GetObject(int id)

Parameters

id int

The identifier of the object.

Returns

GlobalObject

The object with the specified identifier or null if no object could be found.

GetPickup(int)

Gets the pickup with the specified identifier.

BasePickup? GetPickup(int id)

Parameters

id int

The identifier of the pickup.

Returns

BasePickup

The pickup with the specified identifier or null if no pickup could be found.

GetPlayer(int)

Gets the player with the specified identifier.

Player? GetPlayer(int id)

Parameters

id int

The identifier of the player.

Returns

Player

The player with the specified identifier or null if no player could be found.

GetPlayerClass(int)

Gets the player class with the specified identifier.

Class? GetPlayerClass(int id)

Parameters

id int

The identifier of the player class.

Returns

Class

The player class with the specified identifier or null if no player class could be found.

GetPlayerObject(IPlayer, int)

Gets the player object with the specified identifier.

PlayerObject? GetPlayerObject(IPlayer player, int id)

Parameters

player IPlayer

The owner of the player object.

id int

The identifier of the player object.

Returns

PlayerObject

The player object with the specified identifier or null if no player object could be found.

GetPlayerTextDraw(IPlayer, int)

Gets the actor with the specified identifier.

PlayerTextDraw? GetPlayerTextDraw(IPlayer player, int id)

Parameters

player IPlayer

The owner of the player text draw.

id int

The identifier of the actor.

Returns

PlayerTextDraw

The actor with the specified identifier or null if no actor could be found.

GetPlayerTextLabel(IPlayer, int)

Gets the actor with the specified identifier.

PlayerTextLabel? GetPlayerTextLabel(IPlayer player, int id)

Parameters

player IPlayer

The owner of the player text label.

id int

The identifier of the actor.

Returns

PlayerTextLabel

The actor with the specified identifier or null if no actor could be found.

GetTextDraw(int)

Gets the actor with the specified identifier.

TextDraw? GetTextDraw(int id)

Parameters

id int

The identifier of the actor.

Returns

TextDraw

The actor with the specified identifier or null if no actor could be found.

GetTextLabel(int)

Gets the actor with the specified identifier.

TextLabel? GetTextLabel(int id)

Parameters

id int

The identifier of the actor.

Returns

TextLabel

The actor with the specified identifier or null if no actor could be found.

GetVehicle(int)

Gets the actor with the specified identifier.

Vehicle? GetVehicle(int id)

Parameters

id int

The identifier of the actor.

Returns

Vehicle

The actor with the specified identifier or null if no actor could be found.