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 067ed02..9458f1d 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 3e2b860..c6cdd38 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);