Stuyk

C# Developer Kit

Recommended Posts

This project will let you run the server in an .exe file and allow you to also use a special C# reference to hook into an event and send the server custom commands. The server takes 'string' messages and relays them to an event you can hook into.

Installation:

Install directly to your server-files folder.

Installation will be done correctly if you have a Rage Dev Kit folder inside server-files.

Quick start:

Reference the DeveloperKit.dll in your project.

This .dll file can be found inside of the zipped archive.

You may have to add this .dll to your runtime folder. Not entirely sure on this.

Hook into the event -> DeveloperKit.Main.RconEvent.RconEventTrigger += EventHandler;

Compile your C# into a .dll and reference the .dll instead of individual files.

Run the server through the Dev Kit and it should work out.

Using the Event in your Resource:

using DeveloperKit; // Add the using statement.

// Reference Rage.MP Script
public class MyClass : Script 
{
    [ServerEvent(Event.ResourceStart)]
    public void ResourceStart()
    {
        // Hook into the event.
        RconEvent.RconEventTrigger += EventTrigger;
    }
    
    private void EventTrigger(object source, string[] args) {
        // Handle called events here. All events are seperated by spaces.
        
        // Terrible Example:
        if (args[0] == "kick") {
            Console.WriteLine("Kicking...");
        }
    }
}

Download:

Github for Download / Releases

Edited by Stuyk
  • Like 2

Share this post


Link to post
Share on other sites

If anyone has any recommendations for this plugin / tool let me know. I'll be more than happy to implement them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.