Sign in to follow this  
State Valentin

Variable not changing due to spam ?

Recommended Posts

I'm having a chat cef interface.

When a player starts spamming in the chat (Press T > Types something > Press Enter) 

 

Sometimes this bug happens:

mp.events.add('disableChatInput', () => {

mp.gui.cursor.show(false, false);

interfaceOpened = false; // => interfaceOpened is never set to false. keeps being true. Why ? 

});

Vue.js code:

    sendMessage: function() {

      let value = $("#text").val().trim();

      if (value.length > 0) {

        if (value[0] == "/") {

          value = value.substr(1);

          mp.invoke("command", value);

        }

        else {

          mp.invoke("chatMessage", value);

        }

        this.oldMessage = $("#text").val();

      }

      mp.trigger("disableChatInput");

      this.toggleInput(false);

      $("#text").val('');

    }

 

Any idea what to do ? 

 

Client event: 

mp.events.add('disableChatInput', () => {

mp.gui.cursor.show(false, false);

interfaceOpened = false;

});

 

I can't let this bug unfixed. The player remains with the cursor on the screen and interface opened = true. I'm thinking maybe the event is not reaching at all ? 

I've tested this theory.  Had a small notify with numbers to let me know if the number on the chat is the same as the notify send from the client event.

The result: The event is called. So i'm thinking maybe you can't spam the cursor show function ? 

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.