From ee972d524ffec336810631c13c7362ed54012c17 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Sun, 2 Apr 2017 19:02:46 +0300 Subject: [PATCH] Added [Debug]PrintToChatTeam. --- qcsrc/server/player.qc | 20 ++++++++++++++++++++ qcsrc/server/player.qh | 13 +++++++++++++ 2 files changed, 33 insertions(+) diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index fa203b4f6..2658c1830 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -706,6 +706,26 @@ void DebugPrintToChatAll(string text) } } +void PrintToChatTeam(int teamnum, string text) +{ + text = strcat("\{1}^7", text, "\n"); + FOREACH_CLIENT(IS_REAL_CLIENT(it), + { + if (it.team == teamnum) + { + sprint(it, text); + } + }); +} + +void DebugPrintToChatTeam(int teamnum, string text) +{ + if (autocvar_developer) + { + PrintToChatTeam(teamnum, text); + } +} + /** * message "": do not say, just test flood control * return value: diff --git a/qcsrc/server/player.qh b/qcsrc/server/player.qh index 08702316d..b9a5fa928 100644 --- a/qcsrc/server/player.qh +++ b/qcsrc/server/player.qh @@ -35,6 +35,19 @@ void PrintToChatAll(string text); /// \return No return. void DebugPrintToChatAll(string text); +/// \brief Print the string to chat of all players of the specified team. +/// \param[in] teamnum Team to print to. See NUM_TEAM constants. +/// \param[in] text Text to print. +/// \return No return. +void PrintToChatTeam(int teamnum, string text); + +/// \brief Print the string to chat of all players of the specified team if the +/// server cvar "developer" is not 0. +/// \param[in] teamnum Team to print to. See NUM_TEAM constants. +/// \param[in] text Text to print. +/// \return No return. +void DebugPrintToChatTeam(int teamnum, string text); + void player_setupanimsformodel(entity this); void player_anim(entity this); -- 2.39.2