public override void Register()
        {
            Timing.Init(this);

            // -- Register config
            this.AddConfig(new ConfigSetting("tranqgun_enable", true, true, "Whether TranquilizerGun should be enabled on server start."));
            this.AddConfig(new ConfigSetting("tranqgun_use_ghostmode", false, true, "Instead of teleporting players to the void, make them invisible for the duration of tranquilization. REQUIRES SM_ENABLE_GHOSTMODE"));
            this.AddConfig(new ConfigSetting("tranqgun_dropitems", false, true, "If tranquilized targets should drop items from their inventory."));
            this.AddConfig(new ConfigSetting("tranqgun_dropitems_held", false, true, "If the items dropped from tranquilized targets should be randomly chosen instead of all their items."));

            this.AddConfig(new ConfigSetting("tranqgun_damage", 0, true, "Damage dealt by the tranquilizer gun."));
            this.AddConfig(new ConfigSetting("tranqgun_firerate", 3f, true, "Time (in seconds) between each shot."));
            this.AddConfig(new ConfigSetting("tranqgun_magazine", 1, true, "Amount of shots per magazine."));
            this.AddConfig(new ConfigSetting("tranqgun_reserveammo", 2, true, "Default reserve ammo for each player."));

            this.AddConfig(new ConfigSetting("tranqgun_duration", 5f, true, "Time (in seconds) the target is tranquilized for."));

            this.AddConfig(new ConfigSetting("tranqgun_spawns", new string[] { "096chamber" }, true, true, "Locations that the tranquilizer gun can spawn in."));

            // -- Register events
            this.AddEventHandlers(new MiscEventHandler(this), Smod2.Events.Priority.Low);

            // -- Register weapon
            this.Handler = new CustomWeaponHandler <TranquilizerGun>(TranqGunPlugin.TranqID)
            {
                DefaultType = ItemType.USP,
                AmmoName    = "Tranquilizer Dart"
            };
            this.Handler.Register();
            Items.AddRecipe(new Id914Recipe(KnobSetting.FINE, (int)ItemType.USP, TranqGunPlugin.TranqID, 1));

            this.ReloadConfig();
        }
Exemplo n.º 2
0
        public override void Register()
        {
            this.AddConfig(new ConfigSetting("defib_health", 0.1f, true, "The percentage of health the target is revived with."));
            this.AddConfig(new ConfigSetting("defib_delay", 5, true, "The number of seconds before a Defib revives a player."));
            this.AddConfig(new ConfigSetting("defib_spawns", new string[] { "049chamber" }, true, true, "Locations the Defib can spawn in."));
            this.AddConfig(new ConfigSetting("defib_enabled", true, true, "If the defib item should be enabled."));
            this.AddConfig(new ConfigSetting("defib_guards", true, true, "If guards should spawn with Defibs."));

            this.AddEventHandlers(new EventHandler(this), Smod2.Events.Priority.Low);

            Handler = new CustomItemHandler <Defib>(DefibPlugin.DefibID)
            {
                DefaultType = ItemType.WEAPON_MANAGER_TABLET,
            };

            Handler.Register();
            Items.AddRecipe(new Id914Recipe(KnobSetting.FINE, (int)ItemType.WEAPON_MANAGER_TABLET, DefibPlugin.DefibID, 1));
        }
Exemplo n.º 3
0
        public override void Register()
        {
            AddEventHandlers(new EventHandler(this));

            Functions = new Methods(this);

            Shell   = ConfigManager.Manager.Config.GetIntValue("glauncher_shell", 24);
            Handler = new CustomWeaponHandler <GrenadeLauncher>(LauncherId)
            {
                DefaultType        = GetItemTypeFromId(Shell),
                AmmoName           = "Launchable Grenades",
                DefaultReserveAmmo = ReserveAmmo
            };
            Handler.Register();
            Info("Shell ID: " + Shell + " Type From Shell: " + GetItemTypeFromId(Shell) + " Selected Type: " + Handler.DefaultType);

            Items.AddRecipe(new Id914Recipe(KnobSetting.FINE, Shell, LauncherId, 1));
        }