Пример #1
0
        public override void OnDisabled()
        {
            base.OnDisabled();
            Handlers.Player.Joined              -= PlayerEvents.OnPlayerJoined;
            Handlers.Player.ChangingRole        -= PlayerEvents.OnSetClass;
            Handlers.Player.Shooting            -= PlayerEvents.OnPlayerShoot;
            Handlers.Player.InteractingDoor     -= PlayerEvents.OnDoorInteract;
            Handlers.Scp914.Activating          -= PlayerEvents.On914Activate;
            Handlers.Scp914.ChangingKnobSetting -= PlayerEvents.On914Change;
            Handlers.Player.InteractingLocker   -= PlayerEvents.OnLockerInteract;
            Handlers.Player.ItemDropped         -= PlayerEvents.OnDropItem;
            Handlers.Scp079.GainingExperience   -= PlayerEvents.OnSCP079Exp;

            PlayerEvents = null;
        }
Пример #2
0
        public override void OnEnabled()
        {
            base.OnEnabled();
            try
            {
                PlayerEvents = new PlayerEvents(this);

                Handlers.Player.Joined              += PlayerEvents.OnPlayerJoined;
                Handlers.Player.ChangingRole        += PlayerEvents.OnSetClass;
                Handlers.Player.Shooting            += PlayerEvents.OnPlayerShoot;
                Handlers.Player.InteractingDoor     += PlayerEvents.OnDoorInteract;
                Handlers.Scp914.Activating          += PlayerEvents.On914Activate;
                Handlers.Scp914.ChangingKnobSetting += PlayerEvents.On914Change;
                Handlers.Player.InteractingLocker   += PlayerEvents.OnLockerInteract;
                Handlers.Player.ItemDropped         += PlayerEvents.OnDropItem;
                Handlers.Scp079.GainingExperience   += PlayerEvents.OnSCP079Exp;

                Log.Info($"UltimateAFK plugin loaded.\n Written by Thomasjosif for King's Playground");
            }
            catch (Exception e)
            {
                Log.Error($"There was an error loading the plugin: {e}");
            }
        }