Chatter
#1
Chatter
Is a plugin I worked on for a while. It basicly allows you to change the way chat is shown.

Note:
  • It's recommended to load this plugin as one of the latest in case you have other plugins that might block/change the chat message.

Config:
  • UsePlayerColor
    If set to true then the player color will be the color defined in the player's rank.
  • UseRankColor
    The same as UsePlayerColor but then for the {RANK} tag.
  • ChatPerWorld
    If this is set to true then the chat will only be displayed to players who are in the same world as the talking player.
  • ColorSymbol
    With this you can set the symbol that says if there is a color.
  • Prefix
    This is the main feature of this plugin. It allows you to change the way chat is shown. Default is '<{PLAYERNAME}> {MESSAGE}' but you can change it completly how you want. You can use:
    • {PLAYERNAME}
      The name of the player
    • {GROUP}
      The groups where a player is in. If multiple it seperates them with a ','
    • {RANK}
      The rank where a player is in.
    • {WORLD}
      The world the player is in.
    • {WORLDINITIAL}
      The first letter of the world the player is in.
    • {MESSAGE}
      The message the player sends.


  • PersonalPrefixes
    A list with names of players who get their own personal prefix.
    An example can be found by pressing on the Example button below.

  • RankPrefix
    A list with ranks to give to a certain rank.
    An example can be found by pressing on the Example button below.

    Example:

    Prefix         = "@7[{WORLD}]@f<{PLAYERNAME}> {MESSAGE}",
    UsePlayerColor = true,
    UseRankColor   = false,
    ChatPerWorld   = true,
    ColorSymbol    = "@",
    
    PersonalPrefixes =
    {
    	-- You can add a player by using ["PlayerName"] = "Custom Prefix",
    	["STR_Warrior"] = "[{RANK}] <{PLAYERNAME}> {MESSAGE}",
    },
    
    RankPrefixes =
    {
    	-- You can add a specific prefix for a certain rank by using ["Rank"] = Custom Prefix
    	["Admin"] = "@c[Admin]@f {MESSAGE}",
    },
    


API:
API:

Other plugins can hook into Chatter. They can use the RegisterPlugin function using the cPluginManager:CallPlugin function
You use the RegisterPlugin(Tag, PluginObject, FunctionName) function. Here is an example:
--This goes in the OnPluginsLoaded function:
cPluginManager:CallPlugin("Chatter", "RegisterPlugin", "Faction", cPluginManager:Get():GetCurrentPlugin():GetName(), "MessageFunction")

--And this is an example of how the MessageFunction could look like:
function MessageFunction(a_Player)
      local PlayerName = a_Player:GetName()
      if Faction[PlayerName]~= nil then
            return Faction[PlayerName]
      else
            return "Fairy Tail"
      end
end
In this case when Chatter finds "{FACTION}" in the prefix it calls the given function with the player object as parameter. The given function should then return a string that shall replace "{FACTION}".

Note that Chatter automaticly adds the braces around the tag and capitalizes it.


Source: https://github.com/NiLSPACE/Chatter
Download: https://github.com/NiLSPACE/Chatter/archive/master.zip
Reply
Thanks given by:
#2
Hurray, Update. Other plugins are now able to hook into chatter.
Reply
Thanks given by:
#3
Oh god. I have to rewrite this after the Ranks update. I'll do that in the weekend if I remember it Wink. I have a barbecue tomorrow with everyone from my elementary school ;D
Reply
Thanks given by:
#4
There. Updated it. It also has a new Rank tag.

Please note that this is a complete rewrite, because the old code was horrible. The old config file should work if you rename PlayerColor to UsePlayerColor, GroupColor to UseRankColor and BroadcastToServer to ChatPerWorld (And make it true if it was false and vice versa).
Reply
Thanks given by:
#5
Is Chatter For More Users Cuz If I Put A Prefix On My Name But If I Save It All The Other Players In My Minecraft Server Got The Same Prefix As My
Reply
Thanks given by:
#6
Ok. I'm currently changing the plugin so that you can give individual players a different prefix.
Reply
Thanks given by:
#7
Done. I had the change the config file layout so you'll have to reconfigure it. An example can be found in the main thread if you press the Example button.

I'm planning on adding a webadmin interface to make it easier to change the settings and add personal/rank prefixes.
Reply
Thanks given by:
#8
I uploaded the code to Github instead of an attachement here.
Reply
Thanks given by:
#9
will this get integrated to the cms so we can manage it there instead of locally? be much easier than giving admins and ops local access to the files.
Reply
Thanks given by:
#10
It should be possible, but I probably have to split the per-player and per-rank stuff from the config for that.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)