Hello guys,
i'm creating an extension to do advanced stuff outside the sandbox (mostly IO) but whenever my methods, which are hooked onto server events, are called, the console prints the warning in the title.
Here are my basic classes:
Extension:
Code:using System; using Oxide.Core; using Oxide.Core.Extensions; using System; using System.Runtime.CompilerServices; using UnityEngine; using Oxide.Ext.Hive.Plugins;namespace Oxide.Ext.Hive.HiveExtension { public class HiveExtension : Extension { public override string Name { get { return "Hive"; } } public override string Author { get { return "Maverick Applications"; } } public override VersionNumber Version { get { return new VersionNumber(0, 1, 4); } } public HiveExtension(ExtensionManager manager) : base(manager) { } public override void Load() { Manager.RegisterPluginLoader(new HivePluginLoader()); } } }
PluginLoader:
Core plugin:Code:using System; using Oxide.Core.Plugins;namespace Oxide.Ext.Hive.Plugins { public class HivePluginLoader : PluginLoader { public HivePluginLoader() { } public override Type[] CorePlugins { get { return new Type[] { typeof(HiveCore) }; } } public override Plugin Load(string directory, string name) { HiveCore plug = new HiveCore(); LoadedPlugins.Add(name, plug); return plug; } } }
I hope you can help meCode:using System; using Oxide.Core.Plugins; using Oxide.Plugins;namespace Oxide.Ext.Hive { public class HiveCore : RustPlugin { public HiveCore() { } [HookMethod("OnServerSave")] void OnServerSave() { Puts("OnServerSave works!"); } [HookMethod("Init")] void Init() { Puts("Hello!"); } } }
Greetings,
Jackjan
Unable to call hook directly warning with custom extension
Discussion in 'Rust Development' started by Jackjan, Jul 28, 2016.
-
Wulf Community Admin
Extension plugins should be using CSPlugin, not RustPlugin.
-
Oh wow, so easy
Thank you very much
