Table of Contents

Class BasePickup

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

Provides the shared data and functionality of a pickup, regardless of whether it is global (Pickup) or scoped to a single player (PlayerPickup).

public abstract class BasePickup : WorldEntity
Inheritance
BasePickup
Derived
Inherited Members

Constructors

BasePickup(IPickupsComponent, IPickup)

Initializes a new instance of the BasePickup class.

protected BasePickup(IPickupsComponent pickups, IPickup pickup)

Parameters

pickups IPickupsComponent
pickup IPickup

Properties

IsOmpEntityDestroyed

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

protected bool IsOmpEntityDestroyed { get; }

Property Value

bool

Model

Gets the model of this pickup.

public virtual int Model { get; }

Property Value

int

SpawnType

Gets the type of this pickup.

public virtual PickupType SpawnType { get; }

Property Value

PickupType

Methods

OnDestroyComponent()

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

protected override void OnDestroyComponent()

SetModel(int, bool)

Changes the model of this pickup.

public virtual void SetModel(int model, bool update = true)

Parameters

model int

The new model ID.

update bool

Whether to update the pickup visually for streamed-in players.

SetPositionNoUpdate(Vector3)

Sets the position of this pickup without sending a visual update.

public virtual void SetPositionNoUpdate(Vector3 position)

Parameters

position Vector3

The new position.

SetType(PickupType, bool)

Changes the type of this pickup.

public virtual void SetType(PickupType type, bool update = true)

Parameters

type PickupType

The new PickupType.

update bool

Whether to update the pickup visually for streamed-in players.

ToString()

public override string ToString()

Returns

string

Operators

implicit operator IPickup(BasePickup?)

Performs an implicit conversion from BasePickup to IPickup.

public static implicit operator IPickup(BasePickup? pickup)

Parameters

pickup BasePickup

Returns

IPickup