Proposed Message Standardisation
#7
I have a proposal, too Smile

Let's make a bunch of functions in the Core that take care of sending those messages. For example:
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;
Then other plugins can call these functions, too:
-- In the initialization:
function Initialize(a_Plugin)
  g_Core = PluginManager:GetPlugin("Core");
end

-- Send message:
g_Core:Call("SendMessageFatal", Player, "message text");
Reply
Thanks given by: NiLSPACE


Messages In This Thread
Proposed Message Standardisation - by tigerw - 08-08-2013, 02:45 AM
RE: Proposed Message Standardisation - by bearbin - 08-08-2013, 02:47 AM
RE: Proposed Message Standardisation - by tigerw - 08-08-2013, 03:11 AM
RE: Proposed Message Standardisation - by tigerw - 08-08-2013, 03:22 AM
RE: Proposed Message Standardisation - by xoft - 08-08-2013, 06:36 AM
RE: Proposed Message Standardisation - by bearbin - 08-08-2013, 06:47 AM
RE: Proposed Message Standardisation - by xoft - 08-08-2013, 06:52 AM
RE: Proposed Message Standardisation - by xoft - 02-06-2014, 09:06 PM
RE: Proposed Message Standardisation - by tigerw - 02-07-2014, 04:33 AM
RE: Proposed Message Standardisation - by bearbin - 02-07-2014, 05:30 AM
RE: Proposed Message Standardisation - by xoft - 02-07-2014, 07:24 AM
RE: Proposed Message Standardisation - by xoft - 02-07-2014, 07:56 AM
RE: Proposed Message Standardisation - by xoft - 02-07-2014, 08:44 PM
RE: Proposed Message Standardisation - by xoft - 02-08-2014, 12:27 AM
RE: Proposed Message Standardisation - by tigerw - 02-08-2014, 04:14 AM
RE: Proposed Message Standardisation - by bearbin - 02-08-2014, 04:40 AM
RE: Proposed Message Standardisation - by tigerw - 02-08-2014, 07:10 AM
RE: Proposed Message Standardisation - by tigerw - 02-08-2014, 08:04 AM
RE: Proposed Message Standardisation - by xoft - 02-08-2014, 08:37 AM
RE: Proposed Message Standardisation - by tigerw - 02-09-2014, 07:09 AM



Users browsing this thread: 8 Guest(s)