From: Lyberta Date: Sun, 2 Apr 2017 16:02:46 +0000 (+0300) Subject: Added [Debug]PrintToChatTeam. X-Git-Tag: xonotic-v0.8.5~2842^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ee972d524ffec336810631c13c7362ed54012c17;p=xonotic%2Fxonotic-data.pk3dir.git Added [Debug]PrintToChatTeam. --- 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);