Skip to main content

Introduction

This plugin allows items to consume ammo and show reload states

Fields#

NameDescription
Accepted Ammo IdsTypes of ammo this item can use (first in list is used by default)
Rounds Per Shot StatAmount of ammo used on each ConsumeAmmo() call
Loaded Count StatUpdate stat with the loaded count
Magazine Size StatMaximum ammo this item can store at one time
Starting Ammo CountAmount of starting ammo
Auto ReloadAutomaticaly reload on empty if able
On Action State ChangedEvent raised whenever the action state changes

Properties#

NameDescription
instanceIdGet the id of this instance of the object
titleTitle of the plugin
descriptionDescription of the plugin
actionKeysAction keys the plugin responds to
hostInventory hosting the plugin
isActionGets if the plugin is an action
itemGets the item associated with the plugin
iconIcon associated with the plugin
titlebarTextText to display in the titlebar for the plugin

Methods#

NameDescription
ConsumeAmmoConsumes ammo needed to fire. Returns false if insufficient ammo in magazine.
GetCanFireCheck if the weapon can be fired.
InitializeInitialize the plugin
ReloadReload the weapon. Returns false if fully loaded or no available ammo is found.
SwitchAmmoTypeSet the type of ammo to use when firing.
UnloadAmmoUnload any ammo already in the weapon
AfterAddMethod run after item is added to inventory
AllowActionCheck if an action is allowed
BeforeAddMethod run before item is added to inventory
DataSavePrepare data for serialization and saving
HasActionKeyCheck if plugin has action key
IsActionReadyGet if a specific action is ready to perform
OnItemDroppedMethod called when another item is dropped onto this one (return true if event handled)
OnAfterAttackMethod to call whenever the player deals damage to another object
PerformActionPerform the default action
RunCommandRun a command
ShutdownShuts down the object