h1ama3d Posted February 27, 2011 Share Posted February 27, 2011 (edited) Hello .. I have a problem in My Script .. I want to use colors in chat By using this code .. function onChat ( message, messageType ) if messageType == 0 then local root = getRootElement() cancelEvent() outputChatBox ("#ffff00".. getPlayerName ( source ) .. ": #ff00ff" .. message, root, 255, 0, 0, true ) end end addEventHandler ( "onPlayerChat", getRootElement(), onChat ) But it does not work .. This is what shown when i use the chat there is two messages how to hide to original mesage? Please help me (Sorry for the bad English) Edited February 27, 2011 by Guest Link to comment
Xierra Posted February 27, 2011 Share Posted February 27, 2011 Uhh, the screenshot shows that it works. So what exacly the problem do you have here? Did you mean double chat? Link to comment
h1ama3d Posted February 27, 2011 Author Share Posted February 27, 2011 Yeah .. I mean The message show two times! Is there a way to hide the original message? (Thank you to try to help) Link to comment
Moderators Citizen Posted February 27, 2011 Moderators Share Posted February 27, 2011 Hi h1ama3d , You have to find another onPlayerChat and delete the addEventHandler( "onPlayerChat", ... ) or place a return at the top of the function Link to comment
h1ama3d Posted February 27, 2011 Author Share Posted February 27, 2011 Hi h1ama3d ,You have to find another onPlayerChat and delete the addEventHandler( "onPlayerChat", ... ) or place a return at the top of the function i have created a new script And i put the code inside .. But the same problem Please try the code and explore the error .. Thank you Link to comment
h1ama3d Posted February 27, 2011 Author Share Posted February 27, 2011 The problem has been detected .. Code only works in the Race I did not know before .. I'm sorry .. I hope the moderators close the topic .. Thank you .. Link to comment
Moderators Citizen Posted February 27, 2011 Moderators Share Posted February 27, 2011 No problem 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