From b4d9732fe9281d58e6970f336054205471bec74c Mon Sep 17 00:00:00 2001 From: PlasmaPower Date: Sun, 29 May 2016 11:12:18 -0600 Subject: Added GetTeamNames to cScoreboard (#3217) Resolves #3210 --- Server/Plugins/APIDump/APIDesc.lua | 1 + Server/Plugins/Debuggers/Debuggers.lua | 13 +++++++++++++ Server/Plugins/Debuggers/Info.lua | 6 ++++++ 3 files changed, 20 insertions(+) (limited to 'Server') diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua index 43e805a50..0f399bd07 100644 --- a/Server/Plugins/APIDump/APIDesc.lua +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -2196,6 +2196,7 @@ end GetObjective = { Params = "string", Return = "{{cObjective}}", Notes = "Returns the objective with the specified name." }, GetObjectiveIn = { Params = "DisplaySlot", Return = "{{cObjective}}", Notes = "Returns the objective in the specified display slot. Can be nil." }, GetTeam = { Params = "string", Return = "{{cTeam}}", Notes = "Returns the team with the specified name." }, + GetTeamNames = { Params = "", Return = "array table of strings", Notes = "Returns the names of all teams" }, RegisterObjective = { Params = "Name, DisplayName, Type", Return = "{{cObjective}}", Notes = "Registers a new scoreboard objective. Returns the {{cObjective}} instance, nil on error." }, RegisterTeam = { Params = "Name, DisplayName, Prefix, Suffix", Return = "{{cTeam}}", Notes = "Registers a new team. Returns the {{cTeam}} instance, nil on error." }, RemoveObjective = { Params = "string", Return = "bool", Notes = "Removes the objective with the specified name. Returns true if operation was successful." }, diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua index c11052071..ae06b4fc9 100644 --- a/Server/Plugins/Debuggers/Debuggers.lua +++ b/Server/Plugins/Debuggers/Debuggers.lua @@ -2184,3 +2184,16 @@ end + +function HandleTeamsCmd(a_Split, a_Player) + local Scoreboard = a_Player:GetWorld():GetScoreBoard() + + a_Player:SendMessage("Teams: " .. table.concat(Scoreboard:GetTeamNames(), ", ")) + + return true +end + + + + + diff --git a/Server/Plugins/Debuggers/Info.lua b/Server/Plugins/Debuggers/Info.lua index 51406c27c..fa85f0532 100644 --- a/Server/Plugins/Debuggers/Info.lua +++ b/Server/Plugins/Debuggers/Info.lua @@ -208,6 +208,12 @@ g_PluginInfo = Handler = HandleBlkCmd, HelpString = "Gets info about the block you are looking at" }, + ["/teams"] = + { + Permission = "debuggers", + Handler = HandleTeamsCmd, + HelpString = "List the teams" + }, }, -- Commands ConsoleCommands = -- cgit v1.2.3