NUI C# Displaying

nui
c

#1

I’m hoping someone can help me out. I’m trying to figure out the NUI in C#.

Html file:
https://pastebin.com/PKsMhpTn

Nothing is displayed when I try to activate it with:
if (Game.IsControlJustPressed(0, Control.Cover))
{
string messageString = “{“enable”:true}”;
SetNuiFocus(true, false);
SendNuiMessage(messageString);
}

I am properly escaping my string, the site is just removing the back slash


#2
<script>
 
if(event.data.enable == true) {
  document.body.style.display = "block";
} else {
  document.body.sytle.display = "none";
}
</script>

This only gets ran once… look at the NUI w/ mouse example. It shows how to set NUI up properly.


#4

Awesome thanks, I’ve got it to work, now to just figure out how to use RegisterNuiCallbackType() in C#