Table of Contents

Class Actor

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

Represents a component which provides the data and functionality of an actor.

public class Actor : WorldEntity
Inheritance
Actor
Inherited Members

Constructors

Actor(IActorsComponent, IActor)

Initializes a new instance of the Actor class.

protected Actor(IActorsComponent actors, IActor actor)

Parameters

actors IActorsComponent
actor IActor

Properties

Angle

Gets or sets the facing angle of this actor.

public virtual float Angle { get; set; }

Property Value

float

Health

Gets or sets the health of this actor.

public virtual float Health { get; set; }

Property Value

float

IsInvulnerable

Gets or sets a value indicating whether this actor is invulnerable.

public virtual bool IsInvulnerable { get; set; }

Property Value

bool

IsOmpEntityDestroyed

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

protected bool IsOmpEntityDestroyed { get; }

Property Value

bool

Skin

Gets or sets the skin of this actor.

public virtual int Skin { get; set; }

Property Value

int

Methods

ApplyAnimation(string, string, float, bool, bool, bool, bool, int)

Applies the specified animation to this actor.

[Obsolete("Use the TimeSpan overload. This int-milliseconds variant is kept for source compatibility and will be removed.")]
public virtual void ApplyAnimation(string library, string name, float fDelta, bool loop, bool lockX, bool lockY, bool freeze, int time)

Parameters

library string

The animation library from which to apply an animation.

name string

The name of the animation to apply within the specified library.

fDelta float

The speed at which to play the animation.

loop bool

A value indicating whether the animation should loop.

lockX bool

A value indicating whether to allow this actor to move along its x-coordinate.

lockY bool

A value indicating whether to allow this actor to move along its y-coordinate.

freeze bool

A value indicating whether to freeze this actor at the end of the animation.

time int

The duration for which to play the animation.

Exceptions

ArgumentNullException

Thrown if library or name is null.

ApplyAnimation(string, string, float, bool, bool, bool, bool, TimeSpan)

Applies the specified animation to this actor.

public virtual void ApplyAnimation(string library, string name, float fDelta, bool loop, bool lockX, bool lockY, bool freeze, TimeSpan time)

Parameters

library string

The animation library from which to apply an animation.

name string

The name of the animation to apply within the specified library.

fDelta float

The speed at which to play the animation.

loop bool

A value indicating whether the animation should loop.

lockX bool

A value indicating whether to allow this actor to move along its x-coordinate.

lockY bool

A value indicating whether to allow this actor to move along its y-coordinate.

freeze bool

A value indicating whether to freeze this actor at the end of the animation.

time TimeSpan

The duration for which to play the animation.

Exceptions

ArgumentNullException

Thrown if library or name is null.

ClearAnimations()

Clears all animations applied to this actor.

public virtual void ClearAnimations()

IsStreamedIn(Player)

Determines whether this actor is streamed in for the specified player.

public virtual bool IsStreamedIn(Player player)

Parameters

player Player

The Player to check.

Returns

bool

true if the actor is streamed in for the player; false otherwise.

OnDestroyComponent()

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

protected override void OnDestroyComponent()

ToString()

public override string ToString()

Returns

string

Operators

implicit operator IActor(Actor?)

Performs an implicit conversion from Actor to IActor.

public static implicit operator IActor(Actor? actor)

Parameters

actor Actor

Returns

IActor