Table of Contents

Struct WeaponSlotData

Namespace
SampSharp.OpenMp.Core.Api
Assembly
SampSharp.OpenMp.Core.dll

Represents data for a weapon slot, including the weapon ID and the amount of ammunition.

public readonly struct WeaponSlotData
Inherited Members

Constructors

WeaponSlotData(byte, int)

Initializes a new instance of the WeaponSlotData struct.

public WeaponSlotData(byte id, int ammo)

Parameters

id byte

The ID of the weapon in the slot.

ammo int

The amount of ammunition for the weapon.

Fields

Ammo

Gets the amount of ammunition for the weapon in the slot.

public readonly int Ammo

Field Value

int

Id

Gets the ID of the weapon in the slot.

public readonly byte Id

Field Value

byte

Properties

Info

The static WeaponInfo entry for this weapon ID. Returns a sentinel (None, slot -1) for invalid IDs.

public WeaponInfo Info { get; }

Property Value

WeaponInfo

Shootable

True if this weapon shoots bullets (and so consumes ammo, can be reloaded, etc.). Mirrors WeaponSlotData::shootable in the open.mp SDK.

public bool Shootable { get; }

Property Value

bool

Slot

The slot this weapon occupies (0-12), or -1 if the weapon ID doesn't map to a real weapon. Mirrors WeaponSlotData::slot in the open.mp SDK.

public int Slot { get; }

Property Value

int