Example #1
0
        public override void OnDisabled()
        {
            CustomItemSpawner.Spawning.EndlessSpawning.Disable();

            var individualSpawns = IndividualSpawns.Instance;

            individualSpawns.Disable();
            individualSpawns.OnSpawnPlayer -= IndividualSpawns_OnSpawnPlayer;

            SpawnerAPI.OnPlayerSpawningAtPoint -= SpawnerAPI_OnPlayerSpawningAtPoint;

            SpookyLights.Disable();
            PlayerLives.Disable();

            ServerEvents.RoundStarted          -= ServerEvents_RoundStarted;
            ServerEvents.WaitingForPlayers     -= ServerEvents_WaitingForPlayers;
            ServerEvents.SendingConsoleCommand -= ServerEvents_SendingConsoleCommand;
            ServerEvents.EndingRound           -= ServerEvents_EndingRound;

            PlayerEvents.Died   -= PlayerEvents_Died;
            PlayerEvents.Joined -= PlayerEvents_Joined;
            PlayerEvents.Left   -= PlayerEvents_Left;
            PlayerEvents.InteractingElevator += PlayerEvents_InteractingElevator;

            Exiled.Events.Handlers.Scp106.Containing -= Scp106_Containing;
            Exiled.Events.Handlers.Warhead.Starting  -= Warhead_Starting;
            Exiled.Events.Handlers.Scp914.Activating -= Scp914_Activating;

            base.OnDisabled();
        }
Example #2
0
        public override void OnEnabled()
        {
            base.OnEnabled();
            Configs = Config;

            var settings = new SpawnSettings();

            settings.DefineSafeSpawnDistances(new DistanceCheckInfo(new[] { RoleType.ClassD }, Config.SafeTeamSpawnDistance, Config.SafeEnemySpawnDistance));
            SpawnerAPI.ApplySettings(settings);

            _harmony.PatchAll();

            CustomItemSpawner.Spawning.EndlessSpawning.Enable();

            var individualSpawns = IndividualSpawns.Instance;

            individualSpawns.Enable();
            individualSpawns.OnSpawnPlayer += IndividualSpawns_OnSpawnPlayer;

            SpookyLights.Enable();
            PlayerLives.Enable();

            SpawnerAPI.OnPlayerSpawningAtPoint += SpawnerAPI_OnPlayerSpawningAtPoint;

            ServerEvents.RoundStarted          += ServerEvents_RoundStarted;
            ServerEvents.WaitingForPlayers     += ServerEvents_WaitingForPlayers;
            ServerEvents.SendingConsoleCommand += ServerEvents_SendingConsoleCommand;
            ServerEvents.EndingRound           += ServerEvents_EndingRound;

            PlayerEvents.Died   += PlayerEvents_Died;
            PlayerEvents.Joined += PlayerEvents_Joined;
            PlayerEvents.Left   += PlayerEvents_Left;
            PlayerEvents.InteractingElevator += PlayerEvents_InteractingElevator;

            Exiled.Events.Handlers.Scp106.Containing += Scp106_Containing;
            Exiled.Events.Handlers.Warhead.Starting  += Warhead_Starting;
            Exiled.Events.Handlers.Scp914.Activating += Scp914_Activating;
        }