weapons stats on server side - spelling fixed, and forgot ssg3000 and kicks

This commit is contained in:
Scott Brooks 2002-02-28 06:09:23 +00:00
parent b110c37ece
commit 02fa6d4eec
1 changed files with 56 additions and 5 deletions

View File

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.8 2002/02/28 06:09:23 blaze
// weapons stats on server side - spelling fixed, and forgot ssg3000 and kicks
//
// Revision 1.7 2002/02/28 05:41:54 blaze // Revision 1.7 2002/02/28 05:41:54 blaze
// weapons stats on client side // weapons stats on client side
// //
@ -727,7 +730,7 @@ CG_DrawWeaponStats
============================== ==============================
*/ */
#define WS_LEFTSIDE 20 #define WS_LEFTSIDE 20
#define WS_TOP 250 #define WS_TOP 230
#define WS_WIDTH 640 - WS_LEFTSIDE * 10 #define WS_WIDTH 640 - WS_LEFTSIDE * 10
#define WS_LINE_WIDTH 1 #define WS_LINE_WIDTH 1
#define WS_PADDING (WS_LINE_WIDTH+2) #define WS_PADDING (WS_LINE_WIDTH+2)
@ -752,7 +755,7 @@ void CG_DrawWeaponStats(void)
if (Alpha > 1.0f) Alpha = 1.0f; if (Alpha > 1.0f) Alpha = 1.0f;
} }
//make room for 8 weapon stats //make room for 8 weapon stats
size = (8*20)+SB_PADDING; size = (10*20)+SB_PADDING;
score = cg.snap->ps.persistant[PERS_SCORE]; score = cg.snap->ps.persistant[PERS_SCORE];
deaths = cg.snap->ps.persistant[PERS_KILLED]; deaths = cg.snap->ps.persistant[PERS_KILLED];
// Score bar - Red: // Score bar - Red:
@ -816,8 +819,8 @@ void CG_DrawWeaponStats(void)
MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f); MAKERGBA(color, 0.0f, 0.0f, 0.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 6, WS_TOP + SB_PADDING, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * 7 * 6, WS_TOP + SB_PADDING,
"Effency", color); "Efficiency", color);
Com_sprintf(String, sizeof(String), "%4i",score); Com_sprintf(String, sizeof(String), "%4i",score);
@ -859,6 +862,10 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
"HC", color); "HC", color);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
"SSG3000", color);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
"Akimbo", color); "Akimbo", color);
@ -867,6 +874,10 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
"Grenade", color); "Grenade", color);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
"Kicks", color);
//Accuracy //Accuracy
@ -911,6 +922,11 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color); String, color);
Com_sprintf(String, sizeof(String), "%.1f%%",100 * (float)cg.records[REC_SSG3000HITS]/(cg.records[REC_SSG3000SHOTS] ? cg.records[REC_SSG3000SHOTS] : 1));
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color);
Com_sprintf(String, sizeof(String), "%.1f%%",100 * (float)cg.records[REC_AKIMBOHITS]/(cg.records[REC_AKIMBOSHOTS] ? cg.records[REC_AKIMBOSHOTS] : 1)); Com_sprintf(String, sizeof(String), "%.1f%%",100 * (float)cg.records[REC_AKIMBOHITS]/(cg.records[REC_AKIMBOSHOTS] ? cg.records[REC_AKIMBOSHOTS] : 1));
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
@ -922,12 +938,13 @@ void CG_DrawWeaponStats(void)
String, color); String, color);
//Hits //Hits
i=2; i=2;
offset=24; offset=24;
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
"Hitts", color); "Hits", color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFESLASHHITS]); Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KNIFESLASHHITS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
@ -964,6 +981,11 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color); String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000HITS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOHITS]); Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOHITS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
@ -974,6 +996,11 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color); String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKHITS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color);
//Shots //Shots
i=2; i=2;
offset = 30; offset = 30;
@ -1016,6 +1043,11 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color); String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000SHOTS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOSHOTS]); Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOSHOTS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
@ -1068,6 +1100,11 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color); String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000KILLS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOKILLS]); Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBOKILLS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
@ -1078,6 +1115,11 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color); String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKKILLS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color);
//Deaths //Deaths
i=2; i=2;
offset = 45; offset = 45;
@ -1120,6 +1162,11 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color); String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_SSG3000DEATHS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBODEATHS]); Com_sprintf(String, sizeof(String), "%d",cg.records[REC_AKIMBODEATHS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f); MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
@ -1130,6 +1177,10 @@ void CG_DrawWeaponStats(void)
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++, CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color); String, color);
Com_sprintf(String, sizeof(String), "%d",cg.records[REC_KICKDEATHS]);
MAKERGBA(color, 1.0f, 1.0f, 1.0f, 1.0f);
CG_DrawSmallStringColor(WS_LEFTSIDE + 6 + SMALLCHAR_WIDTH * offset, WS_TOP + SB_PADDING * 4 + SMALLCHAR_HEIGHT * i++,
String, color);
if ( cg.wstatsRequestTime + 3000 < cg.time ) { if ( cg.wstatsRequestTime + 3000 < cg.time ) {
// the scores are more than two seconds out of data, // the scores are more than two seconds out of data,