I wanted to make my own extension, since there are no good examples of how to make one, I decided to make one myself.
For more in depth information about Extensions, see the Sources section.
- Clone this repository
- Open the solution in Visual Studio
- Build the solution
- Copy the .dll from the bin/Debug folder to your RustDedicated_Data\Managed folder
- Start your server
This file contains the definition of a simple extension
A Library is a way to expose functions to the plugins, ExampleLibrary.cs contains a simple function that adds a and b.
you can use the function in a plugin like this:
using Oxide.Ext.ExampleExtension.Libraries.ExampleLibrary;
using Oxide.Core;
...
ExampleLibrary exampleLibrary = Interface.Oxide.GetLibrary<ExampleLibrary>();
exampleLibrary.Add(1, 2); // returns 3
same goes for Properties:
using Oxide.Ext.ExampleExtension.Libraries.ExampleLibrary;
using Oxide.Core;
...
ExampleLibrary exampleLibrary = Interface.Oxide.GetLibrary<ExampleLibrary>();
exampleLibrary.Foo; // returns "bar"
This is a work in progress but is useable.
If you want to contribute to this example/template, feel free to make a pull request or open an issue.