Quote:
Originally Posted by Naleksuh
In attribute development it's a common need to know when a weapon is equipped to perhaps do a particular action (maybe add a condition, grant health, etc). At this time there's no real good way of doing this
|
There's a few different ways you can check when a weapon is equipped:
- post_inventory_application event (notably, this plugin spawns and equips all items before that event runs, so any item checks like "does this person have a shield" should be correct by this time)
- SDKHooks Equip/Post hooks (also runs on weapon pickups)
- Various options through DHooks
That can all be done in a separate shared plugin, if not inlined directly within the plugin that needs it; there's no special handling that would make it necessary for this plugin to have an implementation.
A native function for other plugins to identify a specific custom item from an entity is something I do intend to add in the future (likely by embedding the weapon ID through one of the supported attribute systems).
__________________