]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added [Debug]PrintToChatTeam.
authorLyberta <lyberta@lyberta.net>
Sun, 2 Apr 2017 16:02:46 +0000 (19:02 +0300)
committerLyberta <lyberta@lyberta.net>
Sun, 2 Apr 2017 16:02:46 +0000 (19:02 +0300)
qcsrc/server/player.qc
qcsrc/server/player.qh

index fa203b4f667859e0bb4a624675383ad7df4629bf..2658c1830d34bca314d8c0dfe90ff465cbac6524 100644 (file)
@@ -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:
index 08702316d40deab492adbe66cdae7d30dd15fa85..b9a5fa928835208119144e2d7749149c7685af4e 100644 (file)
@@ -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);