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
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
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.
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