Add logging to /t

master
rubenwardy 2015-11-28 00:55:46 +00:00
parent b16d5c3b65
commit e672344383
2 changed files with 10 additions and 7 deletions

View File

@ -1,5 +1,8 @@
-- Get or add a team -- Get or add a team
function ctf.team(name) function ctf.team(name)
if name == nil then
return nil
end
if type(name) == "table" then if type(name) == "table" then
if not name.add_team then if not name.add_team then
ctf.error("team", "Invalid table given to ctf.team") ctf.error("team", "Invalid table given to ctf.team")

View File

@ -251,13 +251,13 @@ minetest.register_chatcommand("t", {
return return
end end
if ctf.player(name).team then local tname = ctf.player(name).team
local team = ctf.team(ctf.player(name).team) local team = ctf.team(tname)
if team then if team then
for username, to in pairs(team.players) do minetest.log("action", tname .. "<" .. name .. "> ** ".. param .. " **")
minetest.chat_send_player(username, for username, to in pairs(team.players) do
"<" .. name .. "> ** " .. param .. " **") minetest.chat_send_player(username,
end tname .. "<" .. name .. "> ** " .. param .. " **")
end end
else else
minetest.chat_send_player(name, minetest.chat_send_player(name,