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

IsHiddenForPlayer(Player)

Checks whether this pickup is hidden for the specified player.

public virtual bool IsHiddenForPlayer(Player player)

Parameters

player Player

The player.

Returns

bool

true if hidden; otherwise false.

IsStreamedInForPlayer(Player)

Checks whether this pickup is streamed in for the specified player.

public virtual bool IsStreamedInForPlayer(Player player)

Parameters

player Player

The player.

Returns

bool

true if streamed in; otherwise false.

OnDestroyComponent()

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

protected override void OnDestroyComponent()

SetHiddenForPlayer(Player, bool)

Hides or shows this pickup for the specified player.

public virtual void SetHiddenForPlayer(Player player, bool hidden)

Parameters

player Player

The player.

hidden bool

true to hide; false to show.

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.

StreamInForPlayer(Player)

Streams this pickup in for the specified player.

public virtual void StreamInForPlayer(Player player)

Parameters

player Player

The player.

StreamOutForPlayer(Player)

Streams this pickup out for the specified player.

public virtual void StreamOutForPlayer(Player player)

Parameters

player Player

The player.

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