Ejemplo n.º 1
0
        private void Disable()
        {
            if (!_enabled)
            {
                return;
            }
            LogUtils.Log("Disabling plugin: " + Name + " (" + GetType().Name + ")");
            Scheduler.Instance?.RemoveAllTasks(this);
            EventManager.Instance?.ClearListeners(this);
            CommandManager.Instance?.OnPluginDisabled(this);
            VehicleManager.Instance?.OnPluginDisabled(this);
            PlayerModelController.OnPluginUnload(this);

            try
            {
                OnDisable();
            }
            catch (Exception e)
            {
                e.Log("Exception while disabling plugin: " + Name);
            }
            _enabled = false;
        }