You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 19, 2021. It is now read-only.
Steven Webster edited this page Jan 30, 2021
·
2 revisions
As of 1.3.0, AdvancedSubclassing allows 3rd party plugins to register 2 methods to obtain and callback to register custom weapons.
The method you should do this under is in the API and is called RegisterCustomWeaponGetter(MethodInfo, MethodInfo). This method takes 2 MethodInfos. Both of these methods must be static.
The first one is the weapon getter, this method must accept a single string value being the name of the weapon AdvancedSubclassing is trying to find. The method must return null or an ItemSyncInfo. An ItemSyncInfo with the id set to ItemType.None will be treated as a null return.
The second method is essentially callback to your plugin after the item is successfully given to a player and it must accept (Player, string, ItemSyncInfo) as its parameters. The Player is the actual player it was given to, the string is the name of the weapon and the ItemSyncInfo is the item after the player has received it so you can use the uniq for tracking to add functionality to your weapons.