Help | C# Nui struggles

For the life of me I cant figure out how I should get NUI to work using C#, and let me already apologize upfront if this is a stupid question.

I’ve put the code on github, including the __resource.lua. Its all test code atm, im trying to figure stuff out.
https://github.com/Horizahn/PoliceRadar
Inside my test server the structure is as following:
resources/policeradar/dlls for dll files and lua
resources/policeradar/web for the web files

Its based on this demo https://github.com/Rene-Sackers/ui-mouse-example

So basically, I have no clue whether the demo is outdated or not and im struggling to find recent information.
As far as I know there isn’t a RegisterNuiCallback function either in the native library.

If anyone could help me out, that’d be much appreciated.

I haven’t done much with nui but I believe it can be done like this in your C# class.

public Whatever()
{
     Function.Call(Hash.REGISTER_NUI_CALLBACK_TYPE, "nuiEventName");
     EventHandlers["nuiEventName"] += new Action(FunctionToRun);
}
private void FunctionToRun()
{
     //Do Something
}

Oh boy, i hope its not that easy… I’d have to punch myself :sweat_smile: i’ll give it a shot later tonight and i’ll let you know.

Was it?