MineClone5/mods/MISC/mcl_commands/say.lua

18 lines
507 B
Lua
Raw Normal View History

local S = minetest.get_translator(minetest.get_current_modname())
2021-03-05 09:47:48 +01:00
minetest.register_privilege("announce", {
description = S("Can use /say"),
give_to_singleplayer = false,
})
minetest.register_chatcommand("say", {
params = S("<message>"),
description = S("Send a message to every player"),
privs = {announce=true},
func = function(name, param)
if not param then
2022-01-02 07:58:29 +01:00
return false, S("Invalid usage, see /help @1.", "say")
2021-03-05 09:47:48 +01:00
end
minetest.chat_send_all(("["..name.."] "..param))
return true
end,
})