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$
// 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
// Added damage in scoreboard.
//
@ -1261,9 +1265,14 @@ static void CG_ServerCommand( void ) {
// NiceAss: LCA
if ( !strcmp( cmd, "lights") ) {
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_Printf("\nLIGHTS...\n");
CG_AddBufferedSound(cgs.media.lightsSound);
trap_S_StartLocalSound(cgs.media.lightsSound, CHAN_ANNOUNCER);
// CG_AddBufferedSound(cgs.media.lightsSound);
return;
}
if ( !strcmp( cmd, "camera") ) {
@ -1279,14 +1288,20 @@ static void CG_ServerCommand( void ) {
CG_AddBufferedSound(cgs.media.actionSound);
return;
}
if ( !strcmp( cmd, "roundbegin") ) {
// JBravo: client commands to use instead of CLIENTINFO cvars.
if (!strcmp(cmd, "roundbegin")) {
trap_Cvar_Set("cg_RQ3_team_round_going", "1");
return;
}
if ( !strcmp( cmd, "roundend") ) {
if (!strcmp(cmd, "roundend")) {
trap_Cvar_Set("cg_RQ3_team_round_going", "0");
return;
}
if (!strcmp(cmd, "mapend")) {
cg.showScores = qtrue;
cg.scoreTPMode = 0;
return;
}
// JBravo: radio. This implementation rules. Used to suck :)
if (!strcmp(cmd, "playradiosound")) {
int sound, gender;

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $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
// Removed all those ifdefs for zcam.
//
@ -1193,10 +1197,14 @@ void BeginIntermission( void ) {
respawn(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
SendScoreboardMessageToAllClients();
if (g_gametype.integer != GT_TEAMPLAY)
SendScoreboardMessageToAllClients();
}

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $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
// Added the use command
//
@ -1421,7 +1425,7 @@ void RQ3_SpectatorMode(gentity_t *ent)
void RQ3_Cmd_Use_f(gentity_t *ent)
{
char *cmd, buf[128];
int weapon;
int weapon, i;
if (!ent->client) {
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));
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) {
if ((ent->client->ps.stats[STAT_WEAPONS] & (1 << WP_KNIFE) ) == (1 << 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));
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) {
trap_SendServerCommand(ent-g_entities, va("print \"Unknown item: %s\n\"", cmd));
return;
}
if (weapon == ent->client->ps.weapon)
return;
Com_sprintf (buf, sizeof(buf), "weapon %d\n", weapon);
trap_SendConsoleCommand(EXEC_APPEND, buf);
}