diff --git a/config/docs.cfg b/config/docs.cfg index 858b5e37..f005654d 100644 --- a/config/docs.cfg +++ b/config/docs.cfg @@ -247,7 +247,9 @@ docargument [B] [triangle debug] [min 0/max 1/default 0]; docremark [Prints details while connecting triangles of 3d models.]; docident [debugargs] [Dump all command arguments to STDOUT]; docargument [...] [...] [] [1]; -docident [echo] []; +docident [echo] [Outputs text to the console.]; +docargument [L] [List of strings] [] [0]; +docident [hudecho] [Outputs text to the console and heads up display.]; docargument [L] [List of strings] [] [0]; docident [exec] [Executes all commands in a specified config file.]; docargument [C] [the config file] [] [0]; diff --git a/docs/reference.xml b/docs/reference.xml index 6306e272..ab8cbad2 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -853,6 +853,14 @@ + Outputs text to the console. + + + + + + + Outputs text to the console and heads up display. diff --git a/source/src/client.cpp b/source/src/client.cpp index a7d760eb..11611ed1 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -270,7 +270,19 @@ void echo(char *text) while(s); } +void hudecho(char *text) +{ + const char *s = strtok(text, "\n"); + do + { + hudoutf("%s", s ? s : ""); + s = strtok(NULL, "\n"); + } + while(s); +} + COMMAND(echo, ARG_CONC); +COMMAND(hudecho, ARG_CONC); COMMANDN(say, toserver, ARG_CONC); COMMANDN(me, toserverme, ARG_CONC); COMMANDN(connect, connectserv, ARG_3STR);