Lukkaz Posted May 29, 2011 Share Posted May 29, 2011 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? Link to comment
Remp Posted May 30, 2011 Share Posted May 30, 2011 I'm not sure about disabling default teamchat, but teamchat messages can be canceled in onPlayerChat, meaning you could make it do whatever you wanted to without touching the binds If you want to bind the chatbox to another key, this might be a good place to start Link to comment
qaisjp Posted May 30, 2011 Share Posted May 30, 2011 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 ) Link to comment
BinSlayer1 Posted May 30, 2011 Share Posted May 30, 2011 @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 Link to comment
Lukkaz Posted May 30, 2011 Author Share Posted May 30, 2011 Yeah, I don't understand either...I got as far as creating my other chatbox but idk how to add the chat into the box... Link to comment
BinSlayer1 Posted May 30, 2011 Share Posted May 30, 2011 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 Link to comment
qaisjp Posted May 31, 2011 Share Posted May 31, 2011 I wasn't giving raw code. I was giving examples. Just edit the bindKey. Link to comment
Callum Posted June 1, 2011 Share Posted June 1, 2011 qaisjp: The first argument of 'outputChatBox' isn't a player element, but rather a string of text. Link to comment
qaisjp Posted June 1, 2011 Share Posted June 1, 2011 qaisjp: The first argument of 'outputChatBox' isn't a player element, but rather a string of text. Aha, yes. Sorry everyone Link to comment
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