mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-12 21:22:14 +00:00
#5453 - Tell command for server.
This commit is contained in:
parent
395225cb7e
commit
ce3ec3ceef
2 changed files with 42 additions and 0 deletions
2
README
2
README
|
@ -298,6 +298,8 @@ New commands
|
|||
|
||||
which <filename/path> - print out the path on disk to a loaded item
|
||||
|
||||
tell <client num> <msg> - send message to a single client (new to server)
|
||||
|
||||
|
||||
--------------------------------------------------------- README for Users -----
|
||||
|
||||
|
|
|
@ -1164,6 +1164,45 @@ static void SV_ConSay_f(void) {
|
|||
SV_SendServerCommand(NULL, "chat \"%s\"", text);
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
SV_ConTell_f
|
||||
==================
|
||||
*/
|
||||
static void SV_ConTell_f(void) {
|
||||
char *p;
|
||||
char text[1024];
|
||||
client_t *cl;
|
||||
|
||||
// make sure server is running
|
||||
if ( !com_sv_running->integer ) {
|
||||
Com_Printf( "Server is not running.\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( Cmd_Argc() < 3 ) {
|
||||
Com_Printf ("Usage: tell <client number> <text>\n");
|
||||
return;
|
||||
}
|
||||
|
||||
cl = SV_GetPlayerByNum();
|
||||
if ( !cl ) {
|
||||
return;
|
||||
}
|
||||
|
||||
strcpy (text, "console_tell: ");
|
||||
p = Cmd_ArgsFrom(2);
|
||||
|
||||
if ( *p == '"' ) {
|
||||
p++;
|
||||
p[strlen(p)-1] = 0;
|
||||
}
|
||||
|
||||
strcat(text, p);
|
||||
|
||||
SV_SendServerCommand(cl, "chat \"%s\"", text);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
|
@ -1299,6 +1338,7 @@ void SV_AddOperatorCommands( void ) {
|
|||
Cmd_AddCommand ("killserver", SV_KillServer_f);
|
||||
if( com_dedicated->integer ) {
|
||||
Cmd_AddCommand ("say", SV_ConSay_f);
|
||||
Cmd_AddCommand ("tell", SV_ConTell_f);
|
||||
}
|
||||
|
||||
Cmd_AddCommand("rehashbans", SV_RehashBans_f);
|
||||
|
|
Loading…
Reference in a new issue