Added "teammodel" for Matchmode, Referee "pause" command

This commit is contained in:
Daniel Simoes 2002-04-28 11:03:46 +00:00
parent 382231faa8
commit d61d238a13
5 changed files with 88 additions and 3 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.98 2002/04/28 11:03:46 slicer
// Added "teammodel" for Matchmode, Referee "pause" command
//
// Revision 1.97 2002/04/26 03:39:34 jbravo
// added tkok, fixed players always leaving zcam modes when player thats
// beeing tracked dies
@ -2840,6 +2843,8 @@ void ClientCommand( int clientNum ) {
MM_Sub_f( ent );
else if (Q_stricmp (cmd, "teamname") == 0)
MM_TeamName_f(ent);
else if (Q_stricmp (cmd, "teammodel") == 0)
MM_TeamModel_f(ent);
// aasimon: referee for MM
else if (Q_stricmp (cmd, "reflogin") == 0)
Ref_Auth ( ent );

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.71 2002/04/28 11:03:46 slicer
// Added "teammodel" for Matchmode, Referee "pause" command
//
// Revision 1.70 2002/04/23 00:21:44 jbravo
// Cleanups of the new model code. Removed the spectator bar for zcam modes.
//
@ -643,6 +646,7 @@ typedef struct {
// Slicer: Matchmode
float matchTime;
qboolean inGame;
qboolean paused;
// JBravo adding TP
int lights_camera_action;
qboolean team_round_going;

View file

@ -117,6 +117,59 @@ void MM_Ready_f(gentity_t *ent) {
trap_SendServerCommand(ent-g_entities, "print \"You need to be a captain for that\n\"");
}
void MM_TeamModel_f(gentity_t *ent) {
int args;
team_t team;
char buff[MAX_TOKEN_CHARS];
team = ent->client->sess.savedTeam;
if(!g_RQ3_matchmode.integer)
return;
if(team == TEAM_SPECTATOR) {
return;
}
args = trap_Argc();
if(args < 2) {
trap_SendServerCommand(ent-g_entities, va("print \"Your current team model is: %s\n\"",
ent->client->sess.savedTeam == TEAM_RED ? g_RQ3_team1model.string : g_RQ3_team2model.string ));
return;
}
else {
if(ent->client->pers.captain == TEAM_FREE) {
trap_SendServerCommand(ent-g_entities, "print \"You need to be a captain for that\n\"");
return;
}
if(level.team_game_going || level.team_round_going) {
trap_SendServerCommand(ent-g_entities, "print \"You cannot change your team's model while playing or ready.\n\"");
}
trap_Argv(1,buff,sizeof(buff));
if(team == TEAM_RED) {
if(g_RQ3_team1ready.integer) {
trap_SendServerCommand(ent-g_entities, "print \"You need to un-ready your team for that..\n\"");
return;
}
trap_Cvar_Set("g_RQ3_team1model",buff);
trap_SendServerCommand(-1,va("print \"New Team 1 Model: %s\n\"",buff));
}
else {
if(g_RQ3_team2ready.integer) {
trap_SendServerCommand(ent-g_entities, "print \"You need to un-ready your team for that..\n\"");
return;
}
trap_Cvar_Set("g_RQ3_team2model",buff);
trap_SendServerCommand(-1,va("print \"New Team 2 Model: %s\n\"",buff));
}
}
}
void MM_TeamName_f(gentity_t *ent) {
int args;
@ -297,7 +350,7 @@ void Ref_Command ( gentity_t *ent){
trap_SendServerCommand( ent-g_entities, "print \"kick player\n\"" );
trap_SendServerCommand( ent-g_entities, "print \"map_restart\n\"" );
trap_SendServerCommand( ent-g_entities, "print \"clear_scores\n\"" );
trap_SendServerCommand( ent-g_entities, "print \"timeout\n\"" );
trap_SendServerCommand( ent-g_entities, "print \"pause\n\"" );
return;
} else if ( Q_stricmp (com, "kick") == 0) { // kick kick kick
@ -327,6 +380,23 @@ void Ref_Command ( gentity_t *ent){
trap_SendConsoleCommand( EXEC_APPEND, "map_restart 0\n" );
return;
}
else if(Q_stricmp (com, "pause") == 0 ){
if(level.paused) {
trap_SendServerCommand( -1, "cp \"Game resumed by Referee.\n\"");
level.paused = false;
}
else {
if(level.team_game_going) {
if(level.inGame)
trap_SendServerCommand( ent-g_entities, "print \"Game will be paused at the end of the round"
else
trap_SendServerCommand( -1, "cp \"Game is now paused by the Referee.\n\"");
level.paused = true;
}
else
trap_SendServerCommand( ent-g_entities, "print \"No game is going..");
}
}
else
trap_SendServerCommand( ent-g_entities, "print \"Invalid Referee comand. Type ref help to see a list of available commands\n\"" );

View file

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

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.66 2002/04/28 11:03:46 slicer
// Added "teammodel" for Matchmode, Referee "pause" command
//
// Revision 1.65 2002/04/26 03:39:34 jbravo
// added tkok, fixed players always leaving zcam modes when player thats
// beeing tracked dies
@ -268,7 +271,9 @@ void CheckTeamRules()
} else {
//Slicer: Adding Matchmode
if (g_RQ3_matchmode.integer) {
if (g_RQ3_team1ready.integer && g_RQ3_team2ready.integer)
if(level.paused)
trap_SendServerCommand( -1, "cp \"Referee has paused the Game!\n\"");
else if (g_RQ3_team1ready.integer && g_RQ3_team2ready.integer)
trap_SendServerCommand( -1, "cp \"Not enough players to play!\n\"");
else
trap_SendServerCommand( -1, "cp \"Both Teams Must Be Ready!\n\"");
@ -392,7 +397,7 @@ qboolean BothTeamsHavePlayers()
int onteam1 = 0, onteam2 = 0;
//Slicer: Matchmode
if(g_RQ3_matchmode.integer && (!g_RQ3_team1ready.integer || !g_RQ3_team2ready.integer))
if(g_RQ3_matchmode.integer && (!g_RQ3_team1ready.integer || !g_RQ3_team2ready.integer || level.paused))
return 0;