I figured there were some people that might want something like this for their server so I decided to share it here. It shows if the player speaking is horde or alliance or will also display if they are a Mod/GM/Admin. Just type .chat and your message after. Tested and working on TrinityCore 3.3.5a.
The script has been stripped of some redundant code and now just deals with the default security levels. If you have custom GM ranks just PM me and I'd be glad to help you change the script to suit your needs.
Player: [Horde] or [Alliance]
Moderator/Trial GM: [Mod]
Gamemaster: [GM]
Administrator: [Admin]
Link: [C++] World Chat - Pastebin.com