Table of Contents

Class PlayerTextLabel

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

Represents a component which provides the data and functionality of a per-player 3D text label.

public class PlayerTextLabel : WorldEntity
Inheritance
PlayerTextLabel
Inherited Members

Constructors

PlayerTextLabel(IOmpEntityProvider, IPlayerTextLabelData, IPlayerTextLabel)

Initializes a new instance of the PlayerTextLabel class.

protected PlayerTextLabel(IOmpEntityProvider entityProvider, IPlayerTextLabelData playerTextLabels, IPlayerTextLabel playerTextLabel)

Parameters

entityProvider IOmpEntityProvider
playerTextLabels IPlayerTextLabelData
playerTextLabel IPlayerTextLabel

Properties

AttachedEntity

Gets the entity this player text label is attached to, if any.

public virtual Component? AttachedEntity { get; }

Property Value

Component

AttachedPlayer

Gets the Player this text label is attached to, or null if it is not attached to a player.

public virtual Player? AttachedPlayer { get; }

Property Value

Player

AttachedVehicle

Gets the Vehicle this text label is attached to, or null if it is not attached to a vehicle.

public virtual Vehicle? AttachedVehicle { get; }

Property Value

Vehicle

Color

Gets the Color of this player text label.

public virtual Color Color { get; }

Property Value

Color

DrawDistance

Gets the draw distance of this player text label.

public virtual float DrawDistance { get; }

Property Value

float

IsOmpEntityDestroyed

Gets a value indicating whether the open.mp entity counterpart has been destroyed.

protected bool IsOmpEntityDestroyed { get; }

Property Value

bool

TestLos

Gets a value indicating whether line-of-sight testing is enabled for this player text label.

public virtual bool TestLos { get; }

Property Value

bool

Text

Gets the text displayed in this player text label.

public virtual string Text { get; }

Property Value

string

Methods

Attach(Player, Vector3)

Attaches this player text label to the specified player.

public virtual void Attach(Player player, Vector3 offset = default)

Parameters

player Player

The Player to attach this player text label to.

offset Vector3

The offset position relative to the player as a Vector3.

Attach(Vehicle, Vector3)

Attaches this player text label to the specified vehicle.

public virtual void Attach(Vehicle vehicle, Vector3 offset = default)

Parameters

vehicle Vehicle

The Vehicle to attach this player text label to.

offset Vector3

The offset position relative to the vehicle as a Vector3.

DetachFromPlayer(Vector3)

Detaches this player text label from the player it was attached to and places it at position.

public virtual void DetachFromPlayer(Vector3 position)

Parameters

position Vector3

The new world position.

DetachFromVehicle(Vector3)

Detaches this player text label from the vehicle it was attached to and places it at position.

public virtual void DetachFromVehicle(Vector3 position)

Parameters

position Vector3

The new world position.

OnDestroyComponent()

This method is invoked before this component is destroyed and removed from its entity.

protected override void OnDestroyComponent()

SetColorAndText(Color, string)

Updates the color and text of this player text label in a single operation.

public virtual void SetColorAndText(Color color, string text)

Parameters

color Color

The new color.

text string

The new text.

ToString()

public override string ToString()

Returns

string

Operators

implicit operator IPlayerTextLabel(PlayerTextLabel?)

Performs an implicit conversion from PlayerTextLabel to IPlayerTextLabel.

public static implicit operator IPlayerTextLabel(PlayerTextLabel? playerTextLabel)

Parameters

playerTextLabel PlayerTextLabel

Returns

IPlayerTextLabel