Search Results for

    Show / Hide Table of Contents

    Class Firearm

    A wrapper class for InventorySystem.Items.Firearms.Firearm.

    Inheritance
    System.Object
    TypeCastObject<Item>
    Item
    Firearm
    Implements
    IWrapper<InventorySystem.Items.ItemBase>
    IWrapper<InventorySystem.Items.Firearms.Firearm>
    Inherited Members
    Item.List
    Item.Serial
    Item.IsInInventory
    Item.Scale
    Item.Type
    Item.Category
    Item.TierFlags
    Item.Weight
    Item.IsAmmo
    Item.IsArmor
    Item.IsKeycard
    Item.IsConsumable
    Item.IsThrowable
    Item.IsUsable
    Item.IsWeapon
    Item.IsLightEmitter
    Item.IsDisarmer
    Item.Owner
    Item.Get(ItemBase)
    Item.Get(UInt16)
    Item.Create(ItemType, Player)
    Item.Give(Player)
    Item.Destroy()
    Item.ToString()
    Item.ChangeItemOwner(Player, Player)
    TypeCastObject<Item>.Cast<TObject>()
    TypeCastObject<Item>.Cast<TObject>(TObject)
    TypeCastObject<Item>.As<TObject>()
    TypeCastObject<Item>.Is<TObject>(TObject)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Features.Items
    Assembly: Exiled.API.dll
    Syntax
    public class Firearm : Item, IWrapper<ItemBase>, IWrapper<Firearm>

    Constructors

    | Improve this Doc View Source

    Firearm(Firearm)

    Initializes a new instance of the Firearm class.

    Declaration
    public Firearm(Firearm itemBase)
    Parameters
    Type Name Description
    InventorySystem.Items.Firearms.Firearm itemBase

    The base InventorySystem.Items.Firearms.Firearm class.

    Properties

    | Improve this Doc View Source

    Aiming

    Gets a value indicating whether the firearm is being aimed.

    Declaration
    public bool Aiming { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Ammo

    Gets or sets the amount of ammo in the firearm.

    Declaration
    public byte Ammo { get; set; }
    Property Value
    Type Description
    System.Byte
    | Improve this Doc View Source

    AmmoType

    Gets the AmmoType of the firearm.

    Declaration
    public AmmoType AmmoType { get; }
    Property Value
    Type Description
    AmmoType
    | Improve this Doc View Source

    AttachmentIdentifiers

    Gets the AttachmentIdentifiers of the firearm.

    Declaration
    public IEnumerable<AttachmentIdentifier> AttachmentIdentifiers { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<AttachmentIdentifier>
    | Improve this Doc View Source

    Attachments

    Gets the InventorySystem.Items.Firearms.Attachments.Components.Attachments of the firearm.

    Declaration
    public Attachment[] Attachments { get; }
    Property Value
    Type Description
    InventorySystem.Items.Firearms.Attachments.Components.Attachment[]
    | Improve this Doc View Source

    AvailableAttachments

    Declaration
    public static IReadOnlyDictionary<FirearmType, AttachmentIdentifier[]> AvailableAttachments { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<FirearmType, AttachmentIdentifier[]>
    | Improve this Doc View Source

    Base

    Gets the InventorySystem.Items.Firearms.Firearm that this class is encapsulating.

    Declaration
    public Firearm Base { get; }
    Property Value
    Type Description
    InventorySystem.Items.Firearms.Firearm
    | Improve this Doc View Source

    BaseCode

    Gets the base code of the firearm.

    Declaration
    public uint BaseCode { get; }
    Property Value
    Type Description
    System.UInt32
    | Improve this Doc View Source

    BaseCodes

    Declaration
    public static IReadOnlyDictionary<FirearmType, uint> BaseCodes { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<FirearmType, System.UInt32>
    | Improve this Doc View Source

    CanSeeThroughDark

    Gets a value indicating whether the firearm's flashlight module is enabled or NightVision is being used.

    Declaration
    public bool CanSeeThroughDark { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    FirearmType

    Gets the FirearmType of the firearm.

    Declaration
    public FirearmType FirearmType { get; }
    Property Value
    Type Description
    FirearmType
    | Improve this Doc View Source

    FireRate

    Gets or sets the fire rate of the firearm, if it is an automatic weapon.

    Declaration
    public float FireRate { get; set; }
    Property Value
    Type Description
    System.Single
    Remarks

    This property will not do anything if the firearm is not an automatic weapon.

    See Also
    IsAutomatic
    | Improve this Doc View Source

    FlashlightEnabled

    Gets a value indicating whether the firearm's flashlight module is enabled.

    Declaration
    public bool FlashlightEnabled { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsAutomatic

    Gets a value indicating whether or not the firearm is automatic.

    Declaration
    public bool IsAutomatic { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    MaxAmmo

    Gets or sets the max ammo for this firearm.

    Declaration
    public byte MaxAmmo { get; set; }
    Property Value
    Type Description
    System.Byte
    Remarks

    Disruptor can't be used for MaxAmmo.

    | Improve this Doc View Source

    NightVisionEnabled

    Gets a value indicating whether the firearm's NightVision is being used.

    Declaration
    public bool NightVisionEnabled { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    PlayerPreferences

    Gets a System.Collections.Generic.Dictionary<TKey, TValue> which represents all the preferences for each Player.

    Declaration
    public static IReadOnlyDictionary<Player, Dictionary<FirearmType, AttachmentIdentifier[]>> PlayerPreferences { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyDictionary<Player, System.Collections.Generic.Dictionary<FirearmType, AttachmentIdentifier[]>>
    | Improve this Doc View Source

    Recoil

    Gets or sets the recoil settings of the firearm, if it's an automatic weapon.

    Declaration
    public RecoilSettings Recoil { get; set; }
    Property Value
    Type Description
    CameraShaking.RecoilSettings
    Remarks

    This property will not do anything if the firearm is not an automatic weapon.

    See Also
    IsAutomatic
    | Improve this Doc View Source

    RecoilPattern

    Gets the firearm's InventorySystem.Items.Firearms.FirearmRecoilPattern. Will be null for non-automatic weapons.

    Declaration
    public FirearmRecoilPattern RecoilPattern { get; }
    Property Value
    Type Description
    InventorySystem.Items.Firearms.FirearmRecoilPattern

    Methods

    | Improve this Doc View Source

    AddAttachment(AttachmentIdentifier)

    Adds a AttachmentIdentifier to the firearm.

    Declaration
    public void AddAttachment(AttachmentIdentifier identifier)
    Parameters
    Type Name Description
    AttachmentIdentifier identifier

    The AttachmentIdentifier to add.

    | Improve this Doc View Source

    AddAttachment(AttachmentName)

    Adds a InventorySystem.Items.Firearms.Attachments.Components.Attachment of the specified InventorySystem.Items.Firearms.Attachments.AttachmentName to the firearm.

    Declaration
    public void AddAttachment(AttachmentName attachmentName)
    Parameters
    Type Name Description
    InventorySystem.Items.Firearms.Attachments.AttachmentName attachmentName

    The InventorySystem.Items.Firearms.Attachments.AttachmentName to add.

    | Improve this Doc View Source

    AddAttachment(IEnumerable<AttachmentIdentifier>)

    Adds a System.Collections.Generic.IEnumerable<T> of AttachmentIdentifier to the firearm.

    Declaration
    public void AddAttachment(IEnumerable<AttachmentIdentifier> identifiers)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<AttachmentIdentifier> identifiers

    The System.Collections.Generic.IEnumerable<T> of AttachmentIdentifier to add.

    | Improve this Doc View Source

    AddAttachment(IEnumerable<AttachmentName>)

    Adds a System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Firearms.Attachments.AttachmentName to the firearm.

    Declaration
    public void AddAttachment(IEnumerable<AttachmentName> attachmentNames)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<InventorySystem.Items.Firearms.Attachments.AttachmentName> attachmentNames

    The System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Firearms.Attachments.AttachmentName to add.

    | Improve this Doc View Source

    AddPreference(Player, FirearmType, AttachmentIdentifier[])

    Adds or replaces an existing preference to the PlayerPreferences.

    Declaration
    public void AddPreference(Player player, FirearmType itemType, AttachmentIdentifier[] attachments)
    Parameters
    Type Name Description
    Player player

    The Player of which must be added.

    FirearmType itemType

    The FirearmType to add.

    AttachmentIdentifier[] attachments

    The AttachmentIdentifier[] to add.

    | Improve this Doc View Source

    AddPreference(Player, Dictionary<FirearmType, AttachmentIdentifier[]>)

    Adds or replaces an existing preference to the PlayerPreferences.

    Declaration
    public void AddPreference(Player player, Dictionary<FirearmType, AttachmentIdentifier[]> preference)
    Parameters
    Type Name Description
    Player player

    The Player of which must be added.

    System.Collections.Generic.Dictionary<FirearmType, AttachmentIdentifier[]> preference

    The System.Collections.Generic.Dictionary<TKey, TValue> of FirearmType and AttachmentIdentifier[] to add.

    | Improve this Doc View Source

    AddPreference(Player, KeyValuePair<FirearmType, AttachmentIdentifier[]>)

    Adds or replaces an existing preference to the PlayerPreferences.

    Declaration
    public void AddPreference(Player player, KeyValuePair<FirearmType, AttachmentIdentifier[]> preference)
    Parameters
    Type Name Description
    Player player

    The Player of which must be added.

    System.Collections.Generic.KeyValuePair<FirearmType, AttachmentIdentifier[]> preference

    The System.Collections.Generic.KeyValuePair<TKey, TValue> of FirearmType and AttachmentIdentifier[] to add.

    | Improve this Doc View Source

    AddPreference(IEnumerable<Player>, FirearmType, AttachmentIdentifier[])

    Adds or replaces an existing preference to the PlayerPreferences.

    Declaration
    public void AddPreference(IEnumerable<Player> players, FirearmType type, AttachmentIdentifier[] attachments)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Player> players

    The System.Collections.Generic.IEnumerable<T> of Player of which must be added.

    FirearmType type

    The FirearmType to add.

    AttachmentIdentifier[] attachments

    The AttachmentIdentifier[] to add.

    | Improve this Doc View Source

    AddPreference(IEnumerable<Player>, Dictionary<FirearmType, AttachmentIdentifier[]>)

    Adds or replaces an existing preference to the PlayerPreferences.

    Declaration
    public void AddPreference(IEnumerable<Player> players, Dictionary<FirearmType, AttachmentIdentifier[]> preference)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Player> players

    The System.Collections.Generic.IEnumerable<T> of Player of which must be added.

    System.Collections.Generic.Dictionary<FirearmType, AttachmentIdentifier[]> preference

    The System.Collections.Generic.Dictionary<TKey, TValue> of FirearmType and AttachmentIdentifier[] to add.

    | Improve this Doc View Source

    AddPreference(IEnumerable<Player>, KeyValuePair<FirearmType, AttachmentIdentifier[]>)

    Adds or replaces an existing preference to the PlayerPreferences.

    Declaration
    public void AddPreference(IEnumerable<Player> players, KeyValuePair<FirearmType, AttachmentIdentifier[]> preference)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Player> players

    The System.Collections.Generic.IEnumerable<T> of Player of which must be added.

    System.Collections.Generic.KeyValuePair<FirearmType, AttachmentIdentifier[]> preference

    The System.Collections.Generic.KeyValuePair<TKey, TValue> of FirearmType and AttachmentIdentifier[] to add.

    | Improve this Doc View Source

    ClearAttachments()

    Removes all attachments from the firearm.

    Declaration
    public void ClearAttachments()
    | Improve this Doc View Source

    ClearPreferences()

    Clears all the existing preferences from PlayerPreferences.

    Declaration
    public void ClearPreferences()
    | Improve this Doc View Source

    ClearPreferences(Player)

    Clears all the existing preferences from PlayerPreferences.

    Declaration
    public void ClearPreferences(Player player)
    Parameters
    Type Name Description
    Player player

    The Player of which must be cleared.

    | Improve this Doc View Source

    ClearPreferences(IEnumerable<Player>)

    Clears all the existing preferences from PlayerPreferences.

    Declaration
    public void ClearPreferences(IEnumerable<Player> players)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Player> players

    The System.Collections.Generic.IEnumerable<T> of Player of which must be cleared.

    | Improve this Doc View Source

    Clone()

    Clones current Firearm object.

    Declaration
    public override Item Clone()
    Returns
    Type Description
    Item

    New Firearm object.

    Overrides
    Item.Clone()
    | Improve this Doc View Source

    Create(FirearmType)

    Creates and returns a Firearm representing the provided FirearmType.

    Declaration
    public static Firearm Create(FirearmType type)
    Parameters
    Type Name Description
    FirearmType type

    The type of firearm to create.

    Returns
    Type Description
    Firearm

    The newly created firearm.

    | Improve this Doc View Source

    CreatePickup(Vector3, Quaternion, Boolean)

    Creates the Pickup that based on this Item.

    Declaration
    public override Pickup CreatePickup(Vector3 position, Quaternion rotation = default(Quaternion), bool spawn = true)
    Parameters
    Type Name Description
    UnityEngine.Vector3 position

    The location to spawn the item.

    UnityEngine.Quaternion rotation

    The rotation of the item.

    System.Boolean spawn

    Whether the Pickup should be initially spawned.

    Returns
    Type Description
    Pickup

    The created Pickup.

    Overrides
    Item.CreatePickup(Vector3, Quaternion, Boolean)
    | Improve this Doc View Source

    GetAttachment(AttachmentIdentifier)

    Gets a InventorySystem.Items.Firearms.Attachments.Components.Attachment of the specified AttachmentIdentifier.

    Declaration
    public Attachment GetAttachment(AttachmentIdentifier identifier)
    Parameters
    Type Name Description
    AttachmentIdentifier identifier

    The AttachmentIdentifier to check.

    Returns
    Type Description
    InventorySystem.Items.Firearms.Attachments.Components.Attachment

    The corresponding InventorySystem.Items.Firearms.Attachments.Components.Attachment.

    | Improve this Doc View Source

    RemoveAttachment(AttachmentIdentifier)

    Removes a AttachmentIdentifier from the firearm.

    Declaration
    public void RemoveAttachment(AttachmentIdentifier identifier)
    Parameters
    Type Name Description
    AttachmentIdentifier identifier

    The AttachmentIdentifier to remove.

    | Improve this Doc View Source

    RemoveAttachment(AttachmentName)

    Removes a InventorySystem.Items.Firearms.Attachments.Components.Attachment of the specified InventorySystem.Items.Firearms.Attachments.AttachmentName from the firearm.

    Declaration
    public void RemoveAttachment(AttachmentName attachmentName)
    Parameters
    Type Name Description
    InventorySystem.Items.Firearms.Attachments.AttachmentName attachmentName

    The InventorySystem.Items.Firearms.Attachments.AttachmentName to remove.

    | Improve this Doc View Source

    RemoveAttachment(AttachmentSlot)

    Removes a InventorySystem.Items.Firearms.Attachments.Components.Attachment of the specified InventorySystem.Items.Firearms.Attachments.AttachmentSlot from the firearm.

    Declaration
    public void RemoveAttachment(AttachmentSlot attachmentSlot)
    Parameters
    Type Name Description
    InventorySystem.Items.Firearms.Attachments.AttachmentSlot attachmentSlot

    The InventorySystem.Items.Firearms.Attachments.AttachmentSlot to remove.

    | Improve this Doc View Source

    RemoveAttachment(IEnumerable<AttachmentIdentifier>)

    Removes a System.Collections.Generic.IEnumerable<T> of AttachmentIdentifier from the firearm.

    Declaration
    public void RemoveAttachment(IEnumerable<AttachmentIdentifier> identifiers)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<AttachmentIdentifier> identifiers

    The System.Collections.Generic.IEnumerable<T> of AttachmentIdentifier to remove.

    | Improve this Doc View Source

    RemoveAttachment(IEnumerable<AttachmentName>)

    Removes a list of InventorySystem.Items.Firearms.Attachments.Components.Attachment of the specified System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Firearms.Attachments.AttachmentName from the firearm.

    Declaration
    public void RemoveAttachment(IEnumerable<AttachmentName> attachmentNames)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<InventorySystem.Items.Firearms.Attachments.AttachmentName> attachmentNames

    The System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Firearms.Attachments.AttachmentName to remove.

    | Improve this Doc View Source

    RemoveAttachment(IEnumerable<AttachmentSlot>)

    Removes a list of InventorySystem.Items.Firearms.Attachments.Components.Attachment of the specified System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Firearms.Attachments.AttachmentSlot from the firearm.

    Declaration
    public void RemoveAttachment(IEnumerable<AttachmentSlot> attachmentSlots)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<InventorySystem.Items.Firearms.Attachments.AttachmentSlot> attachmentSlots

    The System.Collections.Generic.IEnumerable<T> of InventorySystem.Items.Firearms.Attachments.AttachmentSlot to remove.

    | Improve this Doc View Source

    RemovePreference(Player, FirearmType)

    Removes a preference from the PlayerPreferences if it already exists.

    Declaration
    public void RemovePreference(Player player, FirearmType type)
    Parameters
    Type Name Description
    Player player

    The Player of which must be removed.

    FirearmType type

    The FirearmType to remove.

    | Improve this Doc View Source

    RemovePreference(Player, IEnumerable<FirearmType>)

    Removes a preference from the PlayerPreferences if it already exists.

    Declaration
    public void RemovePreference(Player player, IEnumerable<FirearmType> types)
    Parameters
    Type Name Description
    Player player

    The Player of which must be removed.

    System.Collections.Generic.IEnumerable<FirearmType> types

    The System.Collections.Generic.IEnumerable<T> of FirearmType to remove.

    | Improve this Doc View Source

    RemovePreference(IEnumerable<Player>, FirearmType)

    Removes a preference from the PlayerPreferences if it already exists.

    Declaration
    public void RemovePreference(IEnumerable<Player> players, FirearmType type)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Player> players

    The System.Collections.Generic.IEnumerable<T> of Player of which must be removed.

    FirearmType type

    The FirearmType to remove.

    | Improve this Doc View Source

    RemovePreference(IEnumerable<Player>, IEnumerable<FirearmType>)

    Removes a preference from the PlayerPreferences if it already exists.

    Declaration
    public void RemovePreference(IEnumerable<Player> players, IEnumerable<FirearmType> types)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<Player> players

    The System.Collections.Generic.IEnumerable<T> of Player of which must be removed.

    System.Collections.Generic.IEnumerable<FirearmType> types

    The System.Collections.Generic.IEnumerable<T> of FirearmType to remove.

    | Improve this Doc View Source

    TryGetAttachment(AttachmentIdentifier, out Attachment)

    Tries to get a InventorySystem.Items.Firearms.Attachments.Components.Attachment of the specified AttachmentIdentifier.

    Declaration
    public bool TryGetAttachment(AttachmentIdentifier identifier, out Attachment firearmAttachment)
    Parameters
    Type Name Description
    AttachmentIdentifier identifier

    The AttachmentIdentifier to check.

    InventorySystem.Items.Firearms.Attachments.Components.Attachment firearmAttachment

    The corresponding InventorySystem.Items.Firearms.Attachments.Components.Attachment.

    Returns
    Type Description
    System.Boolean

    A value indicating whether or not the firearm has the specified InventorySystem.Items.Firearms.Attachments.Components.Attachment.

    | Improve this Doc View Source

    TryGetAttachment(AttachmentName, out Attachment)

    Tries to get a InventorySystem.Items.Firearms.Attachments.Components.Attachment of the specified InventorySystem.Items.Firearms.Attachments.AttachmentName.

    Declaration
    public bool TryGetAttachment(AttachmentName attachmentName, out Attachment firearmAttachment)
    Parameters
    Type Name Description
    InventorySystem.Items.Firearms.Attachments.AttachmentName attachmentName

    The InventorySystem.Items.Firearms.Attachments.AttachmentName to check.

    InventorySystem.Items.Firearms.Attachments.Components.Attachment firearmAttachment

    The corresponding InventorySystem.Items.Firearms.Attachments.Components.Attachment.

    Returns
    Type Description
    System.Boolean

    A value indicating whether or not the firearm has the specified InventorySystem.Items.Firearms.Attachments.Components.Attachment.

    Implements

    IWrapper<T>
    IWrapper<T>

    Extension Methods

    ReflectionExtensions.CopyProperties(Object, Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX