Remmi_Jefferson Posted January 26, 2020 Posted January 26, 2020 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
MrPancakers Posted January 27, 2020 Posted January 27, 2020 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now