Add the commands

master
LoneWolfHT 2019-04-17 13:41:15 -07:00
parent 4ed1311ea6
commit 64d423cc96
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,23 @@
minetest.register_privilege("notify", {
description = "Can use the notice commands",
give_to_singleplayer = false,
give_to_admin = true,
})
minetest.register_chatcommand("notice", {
description = "Sends a notice in chat",
params = "<msg>",
privs = {notify = true},
func = function(name, param)
minetest.chat_send_all(minetest.colorize("#2b74ff", "[NOTICE] "..param))
end,
})
minetest.register_chatcommand("warn", {
description = "Sends a warning in chat",
params = "<msg>",
privs = {notify = true},
func = function(name, param)
minetest.chat_send_all(minetest.colorize("red", "[WARNING] "..param))
end,
})

View File

@ -1,2 +1,7 @@
# Notices
Adds chatcommands Minetest server staff can use for announcements
## Features
* `notify` privilege - Allows players to use the notice commands
* `/notice <msg>` - Sends a blue `[NOTICE] <msg>` in chat
* `/warn <msg>` - Sends a red `[WARNING] <msg>` in chat