Sign in to follow this  
Remmi_Jefferson

Chat does not work

Recommended Posts

mp.keys.bind(0x71, true, function() { 
    if(mp.gui.chat.show(true)){
        mp.gui.chat.show(false);
    }
    else if(mp.gui.chat.show(false)){
        mp.gui.chat.show(true);
    }
});

Does not work :(

Share this post


Link to post
Share on other sites

I'd firstly recommend basic debugging. So your code doesn't work, did you check the logic inside your if statement? Does `mp.gui.chat.show(true)` return what you think it returns? Did you do a simple debug where you output what `mp.gui.chat.show(true)` returns? If not this is how you would of solved the issue in 10 seconds.

`mp.gui.chat.show()` is a function that doesn't return true/false and therefore it's always 'undefined' and therefore only going to hide your chat always. You'd have to create your own method to see if the chat is open, there is this example on the wiki https://wiki.rage.mp/index.php?title=Chat.open

TLDR mp.gui.chat.show() returns undefined, so your code won't ever work.

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.