summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Core/messages.lua
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2013-08-11 17:00:53 +0200
committerAlexander Harkness <bearbin@gmail.com>2013-08-11 17:00:53 +0200
commitcc708f757c19a2e0c66f138897f41d86d46dd0fb (patch)
tree768cee0a544f131cf6964c058ec2881346880804 /MCServer/Plugins/Core/messages.lua
parentAdded the OnHopperPullingItem and OnHopperPushingItem hooks. (diff)
downloadcuberite-cc708f757c19a2e0c66f138897f41d86d46dd0fb.tar
cuberite-cc708f757c19a2e0c66f138897f41d86d46dd0fb.tar.gz
cuberite-cc708f757c19a2e0c66f138897f41d86d46dd0fb.tar.bz2
cuberite-cc708f757c19a2e0c66f138897f41d86d46dd0fb.tar.lz
cuberite-cc708f757c19a2e0c66f138897f41d86d46dd0fb.tar.xz
cuberite-cc708f757c19a2e0c66f138897f41d86d46dd0fb.tar.zst
cuberite-cc708f757c19a2e0c66f138897f41d86d46dd0fb.zip
Diffstat (limited to 'MCServer/Plugins/Core/messages.lua')
-rw-r--r--MCServer/Plugins/Core/messages.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/MCServer/Plugins/Core/messages.lua b/MCServer/Plugins/Core/messages.lua
new file mode 100644
index 000000000..91a4a7337
--- /dev/null
+++ b/MCServer/Plugins/Core/messages.lua
@@ -0,0 +1,27 @@
+-- Use prefixes or not.
+-- If set to true, messages are prefixed, e. g. "[FATAL]". If false, messages are colored.
+g_UsePrefixes = true
+
+function SendMessage(a_Player, a_Message)
+ if (g_UsePrefixes) then
+ a_Player:SendMessage(cChatColor.Yellow .. "[INFO] " .. cChatColor.White .. a_Message)
+ else
+ a_Player:SendMessage(cChatColor.Yellow .. a_Message)
+ end
+end
+
+function SendMessageSuccess(a_Player, a_Message)
+ if (g_UsePrefixes) then
+ a_Player:SendMessage(cChatColor.Green .. "[INFO] " .. cChatColor.White .. a_Message)
+ else
+ a_Player:SendMessage(cChatColor.Green .. a_Message)
+ end
+end
+
+function SendMessageFailure(a_Player, a_Message)
+ if (g_UsePrefixes) then
+ a_Player:SendMessage(cChatColor.Red .. "[INFO] " .. cChatColor.White .. a_Message)
+ else
+ a_Player:SendMessage(cChatColor.Red .. a_Message)
+ end
+end