]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added more useful PrintToChat functions.
authorLyberta <lyberta@lyberta.net>
Thu, 23 Mar 2017 05:04:38 +0000 (08:04 +0300)
committerLyberta <lyberta@lyberta.net>
Thu, 23 Mar 2017 05:04:38 +0000 (08:04 +0300)
qcsrc/server/player.qc
qcsrc/server/player.qh

index 091b97862913b1dbc95f65ed98bad5607eb88e7b..c0460aedc88767b50023a1c5928f9ffa52ce26dd 100644 (file)
@@ -692,6 +692,23 @@ void DebugPrintToChat(entity player, string text)
        }
 }
 
+void PrintToChatAll(string text)
+{
+       text = strcat("\{1}^7", text, "\n");
+       FOREACH_CLIENT(IS_REAL_CLIENT(it),
+       {
+               sprint(it, text);
+       });
+}
+
+void DebugPrintToChatAll(string text)
+{
+       if (autocvar_developer)
+       {
+               PrintToChatAll(text);
+       }
+}
+
 /**
  * message "": do not say, just test flood control
  * return value:
index 40812a7653a7e35e51959f3b23dd7455a50f6cfe..08702316d40deab492adbe66cdae7d30dd15fa85 100644 (file)
@@ -24,6 +24,17 @@ void PrintToChat(entity player, string text);
 /// \return No return.
 void DebugPrintToChat(entity player, string text);
 
+/// \brief Prints the string to all players' chat.
+/// \param[in] text Text to print.
+/// \return No return.
+void PrintToChatAll(string text);
+
+/// \brief Prints the string to all players' chat if the server cvar "developer"
+/// is not 0.
+/// \param[in] text Text to print.
+/// \return No return.
+void DebugPrintToChatAll(string text);
+
 void player_setupanimsformodel(entity this);
 
 void player_anim(entity this);