Add the commands
parent
4ed1311ea6
commit
64d423cc96
23
init.lua
23
init.lua
|
@ -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,
|
||||
})
|
|
@ -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
|
Loading…
Reference in New Issue