Made the TP scoreboard go down at round beginig (not for spectators) and

pop up at intermission.  Also added special to the use command
This commit is contained in:
Richard Allen 2002-04-02 04:18:58 +00:00
parent 468c0073ee
commit 10c042a38a
3 changed files with 54 additions and 5 deletions

View file

@ -5,6 +5,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.26 2002/04/02 04:18:58 jbravo
// Made the TP scoreboard go down at round beginig (not for spectators) and
// pop up at intermission. Also added special to the use command
//
// Revision 1.25 2002/03/30 23:20:10 jbravo // Revision 1.25 2002/03/30 23:20:10 jbravo
// Added damage in scoreboard. // Added damage in scoreboard.
// //
@ -1261,9 +1265,14 @@ static void CG_ServerCommand( void ) {
// NiceAss: LCA // NiceAss: LCA
if ( !strcmp( cmd, "lights") ) { if ( !strcmp( cmd, "lights") ) {
trap_Cvar_Set("cg_RQ3_lca", "1"); trap_Cvar_Set("cg_RQ3_lca", "1");
if (cg.snap->ps.persistant[PERS_TEAM] == TEAM_RED || cg.snap->ps.persistant[PERS_TEAM] == TEAM_BLUE) {
cg.showScores = qfalse;
cg.scoreTPMode = 0;
}
CG_CenterPrint( "LIGHTS...", SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH ); CG_CenterPrint( "LIGHTS...", SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
CG_Printf("\nLIGHTS...\n"); CG_Printf("\nLIGHTS...\n");
CG_AddBufferedSound(cgs.media.lightsSound); trap_S_StartLocalSound(cgs.media.lightsSound, CHAN_ANNOUNCER);
// CG_AddBufferedSound(cgs.media.lightsSound);
return; return;
} }
if ( !strcmp( cmd, "camera") ) { if ( !strcmp( cmd, "camera") ) {
@ -1279,6 +1288,7 @@ static void CG_ServerCommand( void ) {
CG_AddBufferedSound(cgs.media.actionSound); CG_AddBufferedSound(cgs.media.actionSound);
return; return;
} }
// JBravo: client commands to use instead of CLIENTINFO cvars.
if (!strcmp(cmd, "roundbegin")) { if (!strcmp(cmd, "roundbegin")) {
trap_Cvar_Set("cg_RQ3_team_round_going", "1"); trap_Cvar_Set("cg_RQ3_team_round_going", "1");
return; return;
@ -1287,6 +1297,11 @@ static void CG_ServerCommand( void ) {
trap_Cvar_Set("cg_RQ3_team_round_going", "0"); trap_Cvar_Set("cg_RQ3_team_round_going", "0");
return; return;
} }
if (!strcmp(cmd, "mapend")) {
cg.showScores = qtrue;
cg.scoreTPMode = 0;
return;
}
// JBravo: radio. This implementation rules. Used to suck :) // JBravo: radio. This implementation rules. Used to suck :)
if (!strcmp(cmd, "playradiosound")) { if (!strcmp(cmd, "playradiosound")) {
int sound, gender; int sound, gender;

View file

@ -5,6 +5,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.41 2002/04/02 04:18:58 jbravo
// Made the TP scoreboard go down at round beginig (not for spectators) and
// pop up at intermission. Also added special to the use command
//
// Revision 1.40 2002/03/30 21:51:42 jbravo // Revision 1.40 2002/03/30 21:51:42 jbravo
// Removed all those ifdefs for zcam. // Removed all those ifdefs for zcam.
// //
@ -1193,9 +1197,13 @@ void BeginIntermission( void ) {
respawn(client); respawn(client);
} }
MoveClientToIntermission( client ); MoveClientToIntermission( client );
// JBravo: send the TP scoreboard to players
if (g_gametype.integer == GT_TEAMPLAY)
trap_SendServerCommand (i, "mapend");
} }
// send the current scoring to all clients // send the current scoring to all clients
if (g_gametype.integer != GT_TEAMPLAY)
SendScoreboardMessageToAllClients(); SendScoreboardMessageToAllClients();
} }

View file

@ -5,6 +5,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.52 2002/04/02 04:18:58 jbravo
// Made the TP scoreboard go down at round beginig (not for spectators) and
// pop up at intermission. Also added special to the use command
//
// Revision 1.51 2002/03/31 23:41:45 jbravo // Revision 1.51 2002/03/31 23:41:45 jbravo
// Added the use command // Added the use command
// //
@ -1421,7 +1425,7 @@ void RQ3_SpectatorMode(gentity_t *ent)
void RQ3_Cmd_Use_f(gentity_t *ent) void RQ3_Cmd_Use_f(gentity_t *ent)
{ {
char *cmd, buf[128]; char *cmd, buf[128];
int weapon; int weapon, i;
if (!ent->client) { if (!ent->client) {
return; // not fully in game yet return; // not fully in game yet
@ -1479,6 +1483,13 @@ void RQ3_Cmd_Use_f(gentity_t *ent)
trap_SendServerCommand(ent-g_entities, va("print \"Out of item: %s\n\"", RQ3_AKIMBO_NAME)); trap_SendServerCommand(ent-g_entities, va("print \"Out of item: %s\n\"", RQ3_AKIMBO_NAME));
return; return;
} }
} else if (Q_stricmp (cmd, RQ3_GRENADE_NAME) == 0 || Q_stricmp (cmd, "grenade") == 0) {
if ((ent->client->ps.stats[STAT_WEAPONS] & (1 << WP_GRENADE) ) == (1 << WP_GRENADE)) {
weapon = WP_GRENADE;
} else {
trap_SendServerCommand(ent-g_entities, va("print \"Out of item: %s\n\"", RQ3_GRENADE_NAME));
return;
}
} else if (Q_stricmp (cmd, "throwing combat knife") == 0) { } else if (Q_stricmp (cmd, "throwing combat knife") == 0) {
if ((ent->client->ps.stats[STAT_WEAPONS] & (1 << WP_KNIFE) ) == (1 << WP_KNIFE)) { if ((ent->client->ps.stats[STAT_WEAPONS] & (1 << WP_KNIFE) ) == (1 << WP_KNIFE)) {
weapon = WP_KNIFE; weapon = WP_KNIFE;
@ -1495,11 +1506,26 @@ void RQ3_Cmd_Use_f(gentity_t *ent)
trap_SendServerCommand(ent-g_entities, va("print \"Out of item: %s\n\"", RQ3_KNIFE_NAME)); trap_SendServerCommand(ent-g_entities, va("print \"Out of item: %s\n\"", RQ3_KNIFE_NAME));
return; return;
} }
} else if (Q_stricmp (cmd, "special") == 0) {
for (i = WP_NUM_WEAPONS - 1; i > 0; i--) {
if (i == WP_KNIFE || i == WP_PISTOL || i == WP_AKIMBO || i == WP_GRENADE)
continue;
if (ent->client->ps.stats[STAT_WEAPONS] & (1 << i)) {
weapon = i;
break;
}
}
if (weapon == WP_NONE) {
trap_SendServerCommand(ent-g_entities, va("print \"You dont have a special weapon!\n\""));
return;
}
} }
if (weapon == WP_NONE) { if (weapon == WP_NONE) {
trap_SendServerCommand(ent-g_entities, va("print \"Unknown item: %s\n\"", cmd)); trap_SendServerCommand(ent-g_entities, va("print \"Unknown item: %s\n\"", cmd));
return; return;
} }
if (weapon == ent->client->ps.weapon)
return;
Com_sprintf (buf, sizeof(buf), "weapon %d\n", weapon); Com_sprintf (buf, sizeof(buf), "weapon %d\n", weapon);
trap_SendConsoleCommand(EXEC_APPEND, buf); trap_SendConsoleCommand(EXEC_APPEND, buf);
} }