Jump to content

Recommended Posts

Posted

mp.gui.cursor.show(true, true); //Disables the players controls and shows the cursor

mp.keys.bind(0x71, true, function () {   // F2
    mp.gui.cursor.visible = true;

 

How can i add if i press F2 (0x71) key again, cursos becomes invisible?

Posted
let state = !mp.gui.cursor.visible;
mp.gui.cursor.show(state, state);

For example:

mp.keys.bind(0x71, true, () => {
  let state = !mp.gui.cursor.visible;
  mp.gui.cursor.show(state, state);
});

 

Posted

This script is simple to use your idea =>

var ShowCursor = false;

mp.keys.bind(0x71, false, function() { // F2 Key
	ShowCursor = !ShowCursor;
	if (ShowCursor){
		mp.gui.cursor.show(true, true);
	} else {
		mp.gui.cursor.show(false, false);
	}
});

 

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...