Class Pickup
  A pickup element
Pickups are rotating objects that have logic when a player collides with them.
Some default pickups are weapon, health and armor pickups. But you can also have custom pickups with custom logic when hit
 
  
  
  
  
  Assembly: SlipeServer.Server.dll
  Syntax
  
    public class Pickup : Element
   
  Constructors
  
    |
    Edit this page
  
  
    View Source
  
  
  Pickup(Vector3, PickupModel)
  
  
  Declaration
  
    public Pickup(Vector3 position, PickupModel model)
   
  Parameters
  
  
    |
    Edit this page
  
  
    View Source
  
  
  Pickup(Vector3, PickupType, float)
  
  
  Declaration
  
    public Pickup(Vector3 position, PickupType type, float amount)
   
  Parameters
  
  
    |
    Edit this page
  
  
    View Source
  
  
  Pickup(Vector3, WeaponId, ushort)
  
  
  Declaration
  
    public Pickup(Vector3 position, WeaponId type, ushort ammo)
   
  Parameters
  
  
    |
    Edit this page
  
  
    View Source
  
  
  Pickup(Vector3, ushort)
  
  
  Declaration
  
    public Pickup(Vector3 position, ushort model)
   
  Parameters
  
  Properties
  
    |
    Edit this page
  
  
    View Source
  
  
  Ammo
  
  
  Declaration
  
    public ushort? Ammo { get; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  Armor
  
  
  Declaration
  
    public float? Armor { get; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  CollisionShape
  
  
  Declaration
  
    public CollisionShape CollisionShape { get; init; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  ElementType
  The element type as per MTA's specifications. Multiple C# types can share the same MTA element type.
 
  
  Declaration
  
    public override ElementType ElementType { get; }
   
  Property Value
  
  Overrides
  
  
    |
    Edit this page
  
  
    View Source
  
  
  Health
  
  
  Declaration
  
    public float? Health { get; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  IsUsable
  
  
  Declaration
  
    public bool IsUsable { get; set; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  IsVisible
  
  
  Declaration
  
    public bool IsVisible { get; set; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  Model
  
  
  Declaration
  
    public ushort Model { get; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  
  
  
  Declaration
  
    public bool OnFootOnly { get; set; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  PickupType
  
  
  Declaration
  
    public PickupType PickupType { get; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  RespawnTime
  
  
  Declaration
  
    public uint RespawnTime { get; set; }
   
  Property Value
  
  
    |
    Edit this page
  
  
    View Source
  
  
  WeaponType
  
  
  Declaration
  
    public WeaponId? WeaponType { get; }
   
  Property Value
  
  Methods
  
    |
    Edit this page
  
  
    View Source
  
  
  AssociateWith(MtaServer)
  
  
  Declaration
  
    public Pickup AssociateWith(MtaServer server)
   
  Parameters
  
  Returns
  
  
    |
    Edit this page
  
  
    View Source
  
  
  CanBeUsedBy(Player)
  
  
  Declaration
  
    public bool CanBeUsedBy(Player player)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Player | 
        player | 
         | 
      
    
  
  Returns
  
  
    |
    Edit this page
  
  
    View Source
  
  
  ChangeToOrUpdateArmorPickup(float)
  
  
  Declaration
  
    public void ChangeToOrUpdateArmorPickup(float amount)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | float | 
        amount | 
         | 
      
    
  
  
    |
    Edit this page
  
  
    View Source
  
  
  ChangeToOrUpdateCustomPickup(PickupModel)
  
  
  Declaration
  
    public void ChangeToOrUpdateCustomPickup(PickupModel model)
   
  Parameters
  
  
    |
    Edit this page
  
  
    View Source
  
  
  ChangeToOrUpdateCustomPickup(ushort)
  
  
  Declaration
  
    public void ChangeToOrUpdateCustomPickup(ushort model)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | ushort | 
        model | 
         | 
      
    
  
  
    |
    Edit this page
  
  
    View Source
  
  
  ChangeToOrUpdateHealthPickup(float)
  
  
  Declaration
  
    public void ChangeToOrUpdateHealthPickup(float amount)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | float | 
        amount | 
         | 
      
    
  
  
    |
    Edit this page
  
  
    View Source
  
  
  ChangeToOrUpdateWeaponPickup(WeaponId, ushort)
  
  
  Declaration
  
    public void ChangeToOrUpdateWeaponPickup(WeaponId weapon, ushort ammo)
   
  Parameters
  
  
    |
    Edit this page
  
  
    View Source
  
  
  Use(Player)
  
  
  Declaration
  
    public void Use(Player player)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Player | 
        player | 
         | 
      
    
  
  Events
  
    |
    Edit this page
  
  
    View Source
  
  PickupTypeChanged
  
  
  Declaration
  
    public event ElementEventHandler<Pickup, EventArgs>? PickupTypeChanged
   
  Event Type
  
  
    |
    Edit this page
  
  
    View Source
  
  Reset
  
  
  Declaration
  
    public event ElementEventHandler<Pickup, EventArgs>? Reset
   
  Event Type
  
  
    |
    Edit this page
  
  
    View Source
  
  Used
  
  
  Declaration
  
    public event ElementEventHandler<Pickup, PickupUsedEventArgs>? Used
   
  Event Type
  
  Extension Methods