08-08-2013, 06:36 AM
I have a proposal, too 
Let's make a bunch of functions in the Core that take care of sending those messages. For example:
Then other plugins can call these functions, too:

Let's make a bunch of functions in the Core that take care of sending those messages. For example:
1 2 3 4 5 6 7 8 9 10 11 | function SendMessageFatal(a_Player, a_Message) if (g_UsePrefixes) then a_Player:SendMessage(cChatColor.Red .. "[FATAL]" .. cChatColor.White .. a_Message); else a_Player:SendMessage(cChatColor.Red .. a_Message); end end -- global var at the top of the file, for Admin's configuration -- If set to true, messages are prefixed, e. g. "[FATAL]". If false, messages are colored. g_UsePrefixes = true; |
1 2 3 4 5 6 7 | -- In the initialization: function Initialize(a_Plugin) g_Core = PluginManager:GetPlugin( "Core" ); end -- Send message: g_Core:Call( "SendMessageFatal" , Player, "message text" ); |