IWeapons interface
public interface IWeapons The weapons a realm’s Plugins give, each named by its weapon record. A Plugin gets its own view of it from PluginContext.Weapons, so every weapon it registers is listed under its id and goes when it unloads.
A player class’s kit gives only registered weapons, so a weapon record from a mount or a Plugin’s Records/ puts nothing in anyone’s hands until some Plugin registers it. A weapon registered with a behaviour does what its IWeaponBehaviour says while it’s held; one registered without is carried, shown on the wheel and held, and nothing more.
public void Load(PluginContext context)
{
if (context.Realm == Realm.Server)
context.Weapons.Register(ContentId.Parse("gmod:weapon/weapon_physgun"), () => new PhysicsGun());
}
- Assembly
- EvilEngine.Api
- Commit
- 4ff877b1