Jump to content

how to make activation menu


Recommended Posts

Somwhere in your code you have to create browser by using mp.browsers.new(<html path>). You can have some event that is called that creates it. Or you can bind it to some key.
For example you can have it binded to the key "I":

let browser;
// 0x49 = I
mp.keys.bind(0x49, true, () => {
    if(browser === undefined) {
      // Activation of page
        browser = mp.browsers.new("package://yourpackage/index.html");
        mp.gui.cursor.show(true, true);
    } else {
      // If browser exist destroy it
        browser = undefined;
        mp.gui.cursor.show(false, false);

Also mp.gui.cursor.show(true, true); makes player uncontrollable with keyboard and mouse, and shows cursor on screen.

There might be better way to toggle browser but i use it that way.

Link to comment
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.
  • Create New...