diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_servercmds.c | 5 | ||||
-rw-r--r-- | src/game/g_cmds.c | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index 949c3adc..2b02a4e3 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -972,8 +972,13 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) ignore, prefix, name, cgs.clientinfo[ cg.clientNum ].name, maybeColon, INDENT_MARKER, color, text ); if( !ignore[0] ) + { CG_CenterPrint( va( "%sPrivate message from: " S_COLOR_WHITE "%s", color, name ), 200, GIANTCHAR_WIDTH * 4 ); + if( clientNum < 0 || clientNum >= MAX_CLIENTS ) + clientNum = cg.clientNum; + CG_Printf( ">> to reply, say: /m %d [your message] <<\n", clientNum ); + } break; case SAY_RAW: CG_Printf( "%s\n", text ); diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 1396b583..d31e3821 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -3301,13 +3301,13 @@ void Cmd_PrivateMessage_f( gentity_t *ent ) int pids[ MAX_CLIENTS ]; char name[ MAX_NAME_LENGTH ]; char cmd[ 12 ]; - char str[ MAX_STRING_CHARS ]; char text[ MAX_STRING_CHARS ]; char *msg; char color; int i, pcount; int count = 0; qboolean teamonly = qfalse; + char recipients[ MAX_STRING_CHARS ] = ""; if( !g_privateMessages.integer && ent ) { @@ -3333,23 +3333,29 @@ void Cmd_PrivateMessage_f( gentity_t *ent ) // send the message for( i = 0; i < pcount; i++ ) + { if( G_SayTo( ent, &g_entities[ pids[ i ] ], teamonly ? SAY_TPRIVMSG : SAY_PRIVMSG, text ) ) + { count++; + Q_strcat( recipients, sizeof( recipients ), va( "%s" S_COLOR_WHITE ", ", + level.clients[ pids[ i ] ].pers.netname ) ); + } + } // report the results color = teamonly ? COLOR_CYAN : COLOR_YELLOW; - Com_sprintf( str, sizeof( str ), "^%csent to %i player%s", color, count, - ( count == 1 ) ? "" : "s" ); - if( !count ) ADMP( va( "^3No player matching ^7\'%s^7\' ^3to send message to.\n", name ) ); else { ADMP( va( "^%cPrivate message: ^7%s\n", color, text ) ); - ADMP( va( "%s\n", str ) ); + // remove trailing ", " + recipients[ strlen( recipients ) - 2 ] = '\0'; + ADMP( va( "^%csent to %i player%s: " S_COLOR_WHITE "%s\n", color, count, + count == 1 ? "" : "s", recipients ) ); G_LogPrintf( "%s: %d \"%s" S_COLOR_WHITE "\" \"%s\": ^%c%s\n", ( teamonly ) ? "TPrivMsg" : "PrivMsg", |