Added a better end message for MM matches

This commit is contained in:
Daniel Simoes 2002-06-08 10:51:42 +00:00
parent 520e439b2e
commit e57ad61c9d
3 changed files with 17 additions and 2 deletions

View file

@ -5,6 +5,17 @@ int ClientNumberFromString(gentity_t *to, char *s);
int refVotes[2]; // refVotes[0] is the clientnumber red team voted
// refVotes[1] is the clientnumber blue team voted
void SendEndMessage() {
int mins, secs;
mins = (int)floor(level.matchTime / 60.0f);
secs = level.matchTime - (mins * 60);
trap_SendServerCommand( -1, "cp \"Match is Over!\n\"");
trap_SendServerCommand( -1, va("print \"Scores: Team1 [%d] - Team2 [%d] \n\"",level.teamScores[TEAM_RED],level.teamScores[TEAM_BLUE]));
trap_SendServerCommand( -1, va("print \"Total Match Time: %d:%02d \n\"",mins,secs));
}
gentity_t* getEntByName ( char *name ){
gentity_t *ent;
int i;

View file

@ -7,6 +7,7 @@ void MM_ClearScores( void );
void MM_TeamName_f(gentity_t *);
void MM_TeamModel_f(gentity_t *);
void MM_Referee_f(gentity_t *);
void SendEndMessage();
// aasimon: Declarations for Ref system
qboolean Ref_Exists( void );

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.104 2002/06/08 10:51:42 slicer
// Added a better end message for MM matches
//
// Revision 1.103 2002/06/07 19:07:08 slicer
// removed cvars for teamXready, replaced by level.teamXready
//
@ -711,13 +714,13 @@ int WonGame(int winner)
//Slicer : Matchmode
if (g_RQ3_matchmode.integer) {
if (level.matchTime >= g_timelimit.integer * 60) {
SendEndMessage();
level.inGame = level.team_round_going = level.team_round_countdown =
level.team_game_going = level.matchTime = 0;
trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
level.team1ready = qfalse;
level.team2ready = qfalse;
MakeAllLivePlayersObservers ();
trap_SendServerCommand( -1, "cp \"Match is OVER !!!.\n\"");
return 1;
}
}
@ -737,13 +740,13 @@ int WonGame(int winner)
if (level.teamScores[TEAM_RED] >= g_RQ3_roundlimit.integer || level.teamScores[TEAM_BLUE] >= g_RQ3_roundlimit.integer) {
//Slicer : Matchmode
if (g_RQ3_matchmode.integer) {
SendEndMessage();
level.inGame = level.team_round_going = level.team_round_countdown =
level.team_game_going = level.matchTime = 0;
trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND));
level.team1ready = qfalse;
level.team2ready = qfalse;
MakeAllLivePlayersObservers ();
trap_SendServerCommand( -1, "cp \"Match is OVER !!!.\n\"");
return 1;
} else {
//Slicer: Adding a normal console print..