"say" command

master
zmv7 2022-08-14 09:46:53 +00:00 committed by GitHub
parent 1a81f1a556
commit 082157cc1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 32 additions and 0 deletions

View File

@ -102,3 +102,35 @@ core.register_chatcommand("players", {
end
return true, #list.." Online: "..out
end})
local function say_func(name, param)
if not (name and param) then return end
local rank,color = ranks.get_rank(name)
if rank and color then
core.chat_send_all(core.format_chat_message(core.colorize(color,rank).." "..name, param))
else
core.chat_send_all(core.format_chat_message(name, param))
end
if core.get_modpath("irc") then
irc.say("<"..name.."> ".."param")
end
end
local tabl = {
description = "Say message to global chat",
params = "<message>",
privs = {shout=true},
func = function(name, param)
say_func(name, param)
end}
--core.register_on_mods_loaded(function() -- uncomment it if "say" command being overrided by other mod
if core.chatcommands["say"] then
core.override_chatcommand("say",tabl)
else
core.register_chatcommand("say",tabl)
end
--end)