Show / Hide Table of Contents

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

Inheritance
object
Element
Pickup
Inherited Members
Element.Parent
Element.Children
Element.Associations
Element.AssociatedPlayers
Element.Id
Element.TimeContext
Element.Name
Element.position
Element.Position
Element.Right
Element.Up
Element.Forward
Element.rotation
Element.Rotation
Element.velocity
Element.Velocity
Element.turnVelocity
Element.TurnVelocity
Element.interior
Element.Interior
Element.dimension
Element.Dimension
Element.alpha
Element.Alpha
Element.areCollisionsEnabled
Element.AreCollisionsEnabled
Element.isCallPropagationEnabled
Element.IsCallPropagationEnabled
Element.isFrozen
Element.IsFrozen
Element.UpdateContext
Element.IsSync
Element.Subscribers
Element.ElementDataSubscriptions
Element.BroadcastableElementData
Element.Attachment
Element.AttachedElements
Element.IsDestroyed
Element.IsVisibleToEveryone
Element.AddSubscriber(Player)
Element.RemoveSubscriber(Player)
Element.GetAndIncrementTimeContext()
Element.CanUpdateSync(byte)
Element.Destroy()
Element.RunWithContext(Action, ElementUpdateContext)
Element.RunWithContext(Func<Task>, ElementUpdateContext)
Element.RunAsSync(Action, bool)
Element.RunAsSync(Func<Task>, bool)
Element.RemoveFrom(MtaServer)
Element.AssociateWith(Player)
Element.RemoveFrom(Player)
Element.UpdateAssociatedPlayers()
Element.AddChild(Element)
Element.RemoveChild(Element)
Element.IsChildOf(Element)
Element.SetData(string, LuaValue, DataSyncType)
Element.GetData(string, bool)
Element.SubscribeToData(Player, string)
Element.UnsubscribeFromData(Player, string)
Element.UnsubscribeFromAllData(Player)
Element.IsPlayerSubscribedToData(Player, string)
Element.GetPlayersSubcribedToData(string)
Element.AttachTo(Element, Vector3?, Vector3?)
Element.DetachFrom(Element)
Element.CreateFor(IEnumerable<Player>)
Element.CreateFor(Player)
Element.DestroyFor(IEnumerable<Player>)
Element.DestroyFor(Player)
Element.PositionChanged
Element.RotationChanged
Element.VelocityChanged
Element.TurnVelocityChanged
Element.InteriorChanged
Element.DimensionChanged
Element.AlphaChanged
Element.NameChanged
Element.CallPropagationChanged
Element.CollisionEnabledChanged
Element.FrozenChanged
Element.IdChanged
Element.AssociatedWith
Element.RemovedFrom
Element.DataChanged
Element.Attached
Element.Detached
Element.AttachedOffsetChanged
Element.Destroyed
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SlipeServer.Server.Elements
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
Type Name Description
Vector3 position
PickupModel model
| Edit this page View Source

Pickup(Vector3, PickupType, float)

Declaration
public Pickup(Vector3 position, PickupType type, float amount)
Parameters
Type Name Description
Vector3 position
PickupType type
float amount
| Edit this page View Source

Pickup(Vector3, WeaponId, ushort)

Declaration
public Pickup(Vector3 position, WeaponId type, ushort ammo)
Parameters
Type Name Description
Vector3 position
WeaponId type
ushort ammo
| Edit this page View Source

Pickup(Vector3, ushort)

Declaration
public Pickup(Vector3 position, ushort model)
Parameters
Type Name Description
Vector3 position
ushort model

Properties

| Edit this page View Source

Ammo

Declaration
public ushort? Ammo { get; }
Property Value
Type Description
ushort?
| Edit this page View Source

Armor

Declaration
public float? Armor { get; }
Property Value
Type Description
float?
| Edit this page View Source

CollisionShape

Declaration
public CollisionShape CollisionShape { get; init; }
Property Value
Type Description
CollisionShape
| 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
Type Description
ElementType
Overrides
Element.ElementType
| Edit this page View Source

Health

Declaration
public float? Health { get; }
Property Value
Type Description
float?
| Edit this page View Source

IsUsable

Declaration
public bool IsUsable { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

IsVisible

Declaration
public bool IsVisible { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

Model

Declaration
public ushort Model { get; }
Property Value
Type Description
ushort
| Edit this page View Source

OnFootOnly

Declaration
public bool OnFootOnly { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

PickupType

Declaration
public PickupType PickupType { get; }
Property Value
Type Description
PickupType
| Edit this page View Source

RespawnTime

Declaration
public uint RespawnTime { get; set; }
Property Value
Type Description
uint
| Edit this page View Source

WeaponType

Declaration
public WeaponId? WeaponType { get; }
Property Value
Type Description
WeaponId?

Methods

| Edit this page View Source

AssociateWith(MtaServer)

Declaration
public Pickup AssociateWith(MtaServer server)
Parameters
Type Name Description
MtaServer server
Returns
Type Description
Pickup
| Edit this page View Source

CanBeUsedBy(Player)

Declaration
public bool CanBeUsedBy(Player player)
Parameters
Type Name Description
Player player
Returns
Type Description
bool
| 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
Type Name Description
PickupModel model
| 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
Type Name Description
WeaponId weapon
ushort ammo
| 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
Type Description
ElementEventHandler<Pickup, EventArgs>
| Edit this page View Source

Reset

Declaration
public event ElementEventHandler<Pickup, EventArgs>? Reset
Event Type
Type Description
ElementEventHandler<Pickup, EventArgs>
| Edit this page View Source

Used

Declaration
public event ElementEventHandler<Pickup, PickupUsedEventArgs>? Used
Event Type
Type Description
ElementEventHandler<Pickup, PickupUsedEventArgs>

Extension Methods

ElementPropertyRelayingExtensions.AddRelayers(Element)
ElementPropertyRelayingExtensions.RelayChange(Element, Packet)
PickupPropertyRelayingExtensions.AddPickupRelayers(Pickup)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX