Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function colouredChat ( message, cancelEvent() )
- if theType == 0 then --if its normal chat (not /me or teamchat) then
- cancelEvent() --prevent MTA from outputting chat
- message = string.gsub(message, "#%x%x%x%x%x%x", "") --remove any hex tags in a player's chat to prevent custom colours by using lua's string.gsub
- local r,g,b = getPlayerNametagColor ( source ) --get the player's nametag colour
- local chatterName = getPlayerName ( source ) --get his name
- --output a message with the name as his nametag colour, and the rest in white.
- outputChatBox ( chatterName..":#FFFFFF "..message, getRootElement(), 255, 255, 255, true )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement