Skip to content

Subplugins

Batfoxkid edited this page Feb 15, 2020 · 3 revisions

This store uses a subplugin based system for item uses.

The Forward

public ItemResult TextStore_Item(int client, bool equipped, KeyValues item, int index, const char[] name, int &count)
  • client Client index will always be valid as this is called when the client selects the menu item

  • equipped If the client has the item "equipped", this can be used with toggle on/off items

  • item The KeyValues handle of the item, can be used for checking item settings. You are allowed to move the position but do not close the Handle! You can set values but if you know what your doing (probably not). Note, don't save the Handle as it can be changed, store any values needed if your going to do timer/frame based activities.

  • name The name of the item

  • count The amount the client has, this shouldn't really be changed as the return value can handle this.

  • return An ItemResult enum which determines the end result of the item.

ItemResult Enum

  • Item_None Does nothing to the item

  • Item_Used Removes one instance of the item in the client's inventory

  • Item_On Makes the item considered "equipped"

  • Item_Off Makes the item not considered "equipped"