Jump to content

Creating a new chat just for team chat?


Lukkaz

Recommended Posts

Posted

Hey everyone, I was just wondering how I could go about creating a whole different chatbox just for 'y'. Is it possible to disable y for the original chatbox? What are the first steps I should take?

  • MTA Team
Posted

I have already done this before.

Use:

unbindKey("y", "down", "chatbox", "teamsay") 
bindKey("y", "down", "chatbox", "friendsay") 
addCommandHandler("friendsay", 
     function(thePlayer, theMessage) 
              for i,v in ipairs(myFriends) do 
                    outputChatBox(v, theMessage) 
              end 
      end 
) 

Posted

@qaisjp: Weird code. I don't know what it does, but as I see it, your script's messing clientside and serverside :/

What should it be? Because bindKey doesn't have a player element therefore it looks clientside and addCommandHandler has the player element therefore it looks serverside

And the myFriends table in ipairs isn't defined anywhere :/

Posted

Well, since you're saying you've created the new chatbox, all you gotta do now is cancel the event onPlayerChat when it detects a team-message and use the dxDrawText function to draw the message gathered from onPlayerChat (that was cancelled) to your new chatbox

  • MTA Team
Posted
qaisjp: The first argument of 'outputChatBox' isn't a player element, but rather a string of text.

Aha, yes. Sorry everyone :shock::roll:

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