isa_Khamdan Posted August 4, 2013 Share Posted August 4, 2013 Is it possible to make a colored name for a player by his serial and this will be for the chat only so the scoreboards and other stuffs that use getplayername will show the original name? Link to comment
isa_Khamdan Posted August 4, 2013 Author Share Posted August 4, 2013 Yes, it is possible. And how can I do that? Link to comment
bandi94 Posted August 4, 2013 Share Posted August 4, 2013 "onClientChatMessage" cancelEvent() outputChatBox. tocolor(r,g,b) getPlayerSerial Link to comment
csiguusz Posted August 4, 2013 Share Posted August 4, 2013 I don't think you can do this on client-side. There is a simple example of how I would do it. local colors = { ["serial1"]={10, 20, 30}, -- red, green, blue ["serial2"]={100, 200, 30} } addEventHandler ( "onPlayerChat", root, function ( message, type ) if type == 0 then cancelEvent () local serial = getPlayerSerial ( source ) if colors[ serial ] then local r, g, b = unpack ( colors[ serial ] ) outputChatBox ( getPlayerName( source ) .. "#FFFFFF: " .. message, root, r, g, b, true ) else local r, g, b = getPlayerNametagColor ( source ) outputChatBox ( getPlayerName( source ) .. "#FFFFFF: " .. message, root, r, g, b, true ) end end end ) 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