Interface IOmpEntityProvider
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
idintThe identifier of the actor.
Returns
GetComponent(IActor)
Gets the component for the specified actor.
Actor? GetComponent(IActor actor)
Parameters
actorIActorThe 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
playerClassIClassThe 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
gangZoneIGangZoneThe 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
menuIMenuThe 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
npcINPCThe 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
objectIObjectThe 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
pickupIPickupThe 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
playerIPlayerThe 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
playerObjectIPlayerObjectThe player object to get the component for.
playerIPlayerThe 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
playerTextDrawIPlayerTextDrawThe player text draw to get the component for.
playerIPlayerThe 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
playerTextLabelIPlayerTextLabelThe player text label to get the component for.
playerIPlayerThe 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
textDrawITextDrawThe 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
textLabelITextLabelThe 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
vehicleIVehicleThe 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
actorIActorThe 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
playerClassIClassThe 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
gangZoneIGangZoneThe 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
menuIMenuThe 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
npcINPCThe 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
objectIObjectThe 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
pickupIPickupThe 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
playerIPlayerThe 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
playerObjectIPlayerObjectThe player object to get the entity for.
playerIPlayerThe 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
playerTextDrawIPlayerTextDrawThe player text draw to get the entity for.
playerIPlayerThe 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
playerTextLabelIPlayerTextLabelThe player text label to get the entity for.
playerIPlayerThe 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
textDrawITextDrawThe 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
textLabelITextLabelThe 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
vehicleIVehicleThe 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
idintThe 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
idintThe identifier of the menu.
Returns
GetNpc(int)
Gets the NPC with the specified identifier.
Npc? GetNpc(int id)
Parameters
idintThe identifier of the NPC.
Returns
GetObject(int)
Gets the object with the specified identifier.
GlobalObject? GetObject(int id)
Parameters
idintThe 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
idintThe 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
idintThe identifier of the player.
Returns
GetPlayerClass(int)
Gets the player class with the specified identifier.
Class? GetPlayerClass(int id)
Parameters
idintThe identifier of the player class.
Returns
GetPlayerObject(IPlayer, int)
Gets the player object with the specified identifier.
PlayerObject? GetPlayerObject(IPlayer player, int id)
Parameters
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
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
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
idintThe identifier of the actor.
Returns
GetTextLabel(int)
Gets the actor with the specified identifier.
TextLabel? GetTextLabel(int id)
Parameters
idintThe identifier of the actor.
Returns
GetVehicle(int)
Gets the actor with the specified identifier.
Vehicle? GetVehicle(int id)
Parameters
idintThe identifier of the actor.