Class BasePickup
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
pickupsIPickupsComponentpickupIPickup
Properties
IsOmpEntityDestroyed
Gets a value indicating whether the open.mp entity counterpart has been destroyed.
protected bool IsOmpEntityDestroyed { get; }
Property Value
Model
Gets the model of this pickup.
public virtual int Model { get; }
Property Value
SpawnType
Gets the type of this pickup.
public virtual PickupType SpawnType { get; }
Property Value
Methods
IsHiddenForPlayer(Player)
Checks whether this pickup is hidden for the specified player.
public virtual bool IsHiddenForPlayer(Player player)
Parameters
playerPlayerThe player.
Returns
IsStreamedInForPlayer(Player)
Checks whether this pickup is streamed in for the specified player.
public virtual bool IsStreamedInForPlayer(Player player)
Parameters
playerPlayerThe player.
Returns
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
SetModel(int, bool)
Changes the model of this pickup.
public virtual void SetModel(int model, bool update = true)
Parameters
modelintThe new model ID.
updateboolWhether 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
positionVector3The new position.
SetType(PickupType, bool)
Changes the type of this pickup.
public virtual void SetType(PickupType type, bool update = true)
Parameters
typePickupTypeThe new PickupType.
updateboolWhether 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
playerPlayerThe player.
StreamOutForPlayer(Player)
Streams this pickup out for the specified player.
public virtual void StreamOutForPlayer(Player player)
Parameters
playerPlayerThe player.
ToString()
public override string ToString()
Returns
Operators
implicit operator IPickup(BasePickup?)
Performs an implicit conversion from BasePickup to IPickup.
public static implicit operator IPickup(BasePickup? pickup)
Parameters
pickupBasePickup