From: Lyberta Date: Sat, 18 Mar 2017 02:29:38 +0000 (+0300) Subject: Added PrintToChat function. X-Git-Tag: xonotic-v0.8.2~36^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F426%2Fhead;p=xonotic%2Fxonotic-data.pk3dir.git Added PrintToChat function. --- diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 067ed02e9..9458f1dc0 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -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: diff --git a/qcsrc/server/player.qh b/qcsrc/server/player.qh index 3e2b86016..c6cdd3880 100644 --- a/qcsrc/server/player.qh +++ b/qcsrc/server/player.qh @@ -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);