]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added PrintToChat function. 426/head
authorLyberta <lyberta@lyberta.net>
Sat, 18 Mar 2017 02:29:38 +0000 (05:29 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 18 Mar 2017 02:29:38 +0000 (05:29 +0300)
qcsrc/server/player.qc
qcsrc/server/player.qh

index 067ed02e938064cdd78d354372d4d3873515680f..9458f1dc065d2ca0fb99685b042a5ea716c5890e 100644 (file)
@@ -678,6 +678,12 @@ void dedicated_print(string input)
        if (server_is_dedicated) print(input);
 }
 
+void PrintToChat(entity player, string text)
+{
+       text = strcat("\{1}^7", text, "\n");
+       sprint(player, text);
+}
+
 /**
  * message "": do not say, just test flood control
  * return value:
index 3e2b860162203e798733f441d3e35dcd07405bd7..c6cdd3880375b52f5fb3667da35245422ec06ee4 100644 (file)
@@ -11,6 +11,12 @@ void CopyBody(entity this, float keepvelocity);
 
 void dedicated_print(string input);
 
+/// \brief Print the string to player's chat.
+/// \param[in] player Player to print to.
+/// \param[in] text Text to print.
+/// \return No return.
+void PrintToChat(entity player, string text);
+
 void player_setupanimsformodel(entity this);
 
 void player_anim(entity this);