From 93ba34169570ed46e5670251d77d982e514c0bee Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 22 Mar 2019 03:20:31 +0000 Subject: [PATCH] Add ctf.chat_send_team --- ctf/teams.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ctf/teams.lua b/ctf/teams.lua index a86f3e7..9677ed2 100644 --- a/ctf/teams.lua +++ b/ctf/teams.lua @@ -118,6 +118,16 @@ function ctf.player_or_nil(name) return ctf.players[name] end +function ctf.chat_send_team(team, msg) + if type(team) == "string" then + team = ctf.team(team) + end + + for pname, _ in pairs(team.players) do + minetest.chat_send_player(pname, msg) + end +end + function ctf.remove_player(name) ctf.log("team", "Removing player ".. dump(name)) local player = ctf.players[name]