Add /tell
chatcommand
Formatted like /msg, allows registering a msg to be shown the the player specified when they become active.
This commit is contained in:
parent
0914819f5e
commit
a28c39ee94
20
init.lua
20
init.lua
@ -49,3 +49,23 @@ function tell.remove(name, id)
|
|||||||
list[name][id] = nil
|
list[name][id] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- [register] Chatcommand
|
||||||
|
minetest.register_chatcommand("tell", {
|
||||||
|
description = "Send a message to an offline or AFK player",
|
||||||
|
params = "<name> <message>",
|
||||||
|
func = function(name, param)
|
||||||
|
local sendto, msg = param:match("^(%S+)%s(.+)$")
|
||||||
|
if not sendto or not msg then
|
||||||
|
return false, "Invalid usage, see /help tell."
|
||||||
|
end
|
||||||
|
minetest.log("action", "Tell from " .. name .. " to " .. sendto
|
||||||
|
.. ": " .. msg)
|
||||||
|
|
||||||
|
if tell.add(sendto, name, msg) then
|
||||||
|
return true, "I'll pass that on when "..sendto.." is around."
|
||||||
|
else
|
||||||
|
return false, "Unknown error."
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user