diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index 9b5a584f..2eb718dc 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.163 2002/08/27 04:48:13 niceass +// ref say added +// // Revision 1.162 2002/08/24 07:58:49 niceass // moved sanitizestring to g_util // @@ -1447,11 +1450,12 @@ void G_Say(gentity_t * ent, gentity_t * target, int mode, const char *chatText) Com_sprintf(name, sizeof(name), "[DEAD] %s%c%c" EC ": ", ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE); } + color = COLOR_GREEN; } else { Com_sprintf(name, sizeof(name), "%s%c%c" EC ": ", ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE); + color = COLOR_GREEN; } - color = COLOR_GREEN; break; case SAY_TEAM: if (ent->client->sess.sessionTeam == TEAM_SPECTATOR) { @@ -1492,6 +1496,10 @@ void G_Say(gentity_t * ent, gentity_t * target, int mode, const char *chatText) Q_COLOR_ESCAPE, COLOR_WHITE); color = COLOR_MAGENTA; break; + case SAY_REF: + Com_sprintf(name, sizeof(name), "[REFEREE] %s%c%c" EC ": ", ent->client->pers.netname, + Q_COLOR_ESCAPE, COLOR_WHITE); + break; } // JBravo: Parsing % vars here diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index b86737a6..ef7b6ec2 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.119 2002/08/27 04:47:48 niceass +// ref say added +// // Revision 1.118 2002/08/24 07:58:37 niceass // moved sanitizestring to g_util // @@ -886,6 +889,7 @@ void Cmd_FollowCycle_f(gentity_t * ent, int dir); void Cmd_Unzoom(gentity_t * ent); void Cmd_OpenDoor(gentity_t * ent); void Cmd_Weapon(gentity_t * ent); +void G_Say(gentity_t * ent, gentity_t * target, int mode, const char *chatText); //Elder: C3A laser tutorial void Laser_Gen(gentity_t * ent, qboolean enabled); diff --git a/reaction/game/g_matchmode.c b/reaction/game/g_matchmode.c index 63c34733..bcd9d713 100644 --- a/reaction/game/g_matchmode.c +++ b/reaction/game/g_matchmode.c @@ -499,7 +499,8 @@ void Ref_Command(gentity_t * ent) { char com[MAX_TOKEN_CHARS]; char param[MAX_TOKEN_CHARS]; - int cn; + char arg2[MAX_STRING_CHARS]; + int cn, i; //cn = ent - g_entities; if (!ent->client->sess.referee) { @@ -520,6 +521,7 @@ void Ref_Command(gentity_t * ent) trap_SendServerCommand(ent - g_entities, "print\"lockSettings\n\""); trap_SendServerCommand(ent - g_entities, "print \"resetMatch\n\""); trap_SendServerCommand(ent - g_entities, "print\"map \n\""); + trap_SendServerCommand(ent - g_entities, "print\"say \n\""); return; } else if (Q_stricmp(com, "resetMatch") == 0) { MM_ResetMatch(); @@ -595,6 +597,16 @@ void Ref_Command(gentity_t * ent) BeginIntermission(); } } + else if (Q_stricmp(com, "say") == 0) { + arg2[0] = '\0'; + for (i = 2; i < trap_Argc(); i++) { + if (i > 2) + strcat(arg2, " "); + trap_Argv(i, &arg2[strlen(arg2)], sizeof(arg2) - strlen(arg2)); + } + + G_Say(ent, NULL, SAY_REF, arg2); + } else trap_SendServerCommand(ent - g_entities, va("print \""MM_DENY_COLOR"Invalid Referee comand. Type ref help to see a list of available commands\n\"")); diff --git a/reaction/game/q_shared.h b/reaction/game/q_shared.h index 4c683f97..c36d0292 100644 --- a/reaction/game/q_shared.h +++ b/reaction/game/q_shared.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.11 2002/08/27 04:46:33 niceass +// ref say added +// // Revision 1.10 2002/08/21 03:42:36 niceass // move of some vector functions outside of just game // @@ -1463,6 +1466,7 @@ typedef enum _flag_status { #define SAY_ALL 0 #define SAY_TEAM 1 #define SAY_TELL 2 +#define SAY_REF 3 #define CDKEY_LEN 16 #define CDCHKSUM_LEN 2