Jump to content

Hide chat permanently


Piorun

Recommended Posts

I don't really use showChat alot, so excuse my mistake ^^ but you could also try canceling onPlayerCommand event if command was 'showchat' (not sure if will work, but if it does, its better solution rather than using showChat each frame)

I believe only server-side commands can be blocked.

Link to comment
What event did you try to cancel?

Try this (server-side code):

addEventHandler("onPlayerChat", root, function() cancelEvent() end) 

He wants to hide the chat, not prevent messages from being sent.

OK, depends on his usecase, this is indeed true if some players can see the chat and some players will not, where only the first group can really speak with each other.

In that case client-side event onClientChatMessage could be canceled instead.

Link to comment
Ok i did it like that:
addEventHandler("onClientRender",root,function()showChat(false)end) 

I don't know if it's optimal but now i dont care :D.

Holy crap, don't do that.

Use https://wiki.multitheftauto.com/wiki/OnConsole and call showChat whenever someone tries to show it.

Not sure if MTA's internal command system is considered as "existing command handler" in this case, but test it at least.

Link to comment

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