Jump to content

Recommended Posts

Posted (edited)

Hello, I'm using CEF browser to login and register. I have a problem and it's taht I've this:

Clientside

// index.js
mp.gui.chat.activate(false);
mp.gui.chat.show(true);
mp.gui.chat.colors = true;
mp.game.ui.displayRadar(false);
mp.game.gameplay.setFadeOutAfterDeath(false);

mp.events.add("loginResults", (step) => {
	switch(step){
        case "success":
        {
			mp.events.callRemote("login:ok", mp.players.local);
			mp.gui.chat.activate(true);
        }
        case "registered":
        {
			mp.events.callRemote("login:register", mp.players.local);
        }
	}
}

The problem is, if the username or the password has a "T", the chat input is opened. I don't have anywhere else mp.gui.chat.activate, only when the login is correct...

 

I'm not using any customized chat or something.

Edited by hdrtop
Added info
  • Like 1
Posted

I don't know how to check it out, because don't have a game right now, but:

Try to change it to false when the GUI is showing and set to true when it doesn't.

mp.gui.chat.show(true)
Posted (edited)

Solved using 2 events

// Event to hide the chat
mp.gui.chat.activate(false)
mp.gui.chat.show(false)

// Event to show the chat
mp.gui.chat.activate(true)
mp.gui.chat.show(true)

Don't know why, but works!

Edited by hdrtop

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