r1757 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Wed Jul 12 14:18:12 EDT 2006


Author: div0
Date: 2006-07-12 14:18:12 -0400 (Wed, 12 Jul 2006)
New Revision: 1757

Modified:
   trunk/data/qcsrc/server/g_world.qc
Log:
better coloring for "set _scoreboard 1"


Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc	2006-07-12 17:43:39 UTC (rev 1756)
+++ trunk/data/qcsrc/server/g_world.qc	2006-07-12 18:18:12 UTC (rev 1757)
@@ -1098,7 +1098,7 @@
 	return WinningConditionBase_Teamplay(fraglimit);
 }
 
-void PrintScoreboardFor(float whichteam)
+void PrintScoreboardFor(string name, string colorcode, float whichteam)
 {
 	entity head;
 	float fragtotal;
@@ -1110,8 +1110,11 @@
 	{
 		if(!whichteam || head.team == whichteam)
 		{
-			fragtotal = fragtotal + head.frags;
+			if(name != "")
+				if(!found)
+					ServerConsoleEcho(strcat(" ", colorcode, name, ":"), FALSE);
 			found = TRUE;
+			fragtotal = fragtotal + head.frags;
 			s = ftos(head.frags);
 			s = strcat(s, "/", ftos(head.deaths));
 			s = strcat(s, " @ ", ftos(head.ping));
@@ -1119,12 +1122,12 @@
 				s = strcat(s, "botms");
 			else
 				s = strcat(s, "ms");
-			ServerConsoleEcho(strcat("  ", head.netname, "^7 (", s, ")"), TRUE);
+			ServerConsoleEcho(strcat("  ", colorcode, head.netname, colorcode, " (", s, ")"), TRUE);
 		}
 		head = find(head, classname, "player");
 	}
 	if(whichteam && found)
-		ServerConsoleEcho(strcat("  (total: ", ftos(fragtotal), ")"), FALSE);
+		ServerConsoleEcho(strcat(colorcode, "  (total: ", ftos(fragtotal), ")"), FALSE);
 }
 
 void PrintScoreboard()
@@ -1132,18 +1135,14 @@
 	ServerConsoleEcho("Scoreboard:", FALSE);
 	if(teams_matter)
 	{
-		ServerConsoleEcho(" Red:", FALSE);
-		PrintScoreboardFor(COLOR_TEAM1);
-		ServerConsoleEcho(" Blue:", FALSE);
-		PrintScoreboardFor(COLOR_TEAM2);
-		ServerConsoleEcho(" Pink:", FALSE);
-		PrintScoreboardFor(COLOR_TEAM3);
-		ServerConsoleEcho(" Yellow:", FALSE);
-		PrintScoreboardFor(COLOR_TEAM4);
+		PrintScoreboardFor("Red", "^1", COLOR_TEAM1);
+		PrintScoreboardFor("Blue", "^4", COLOR_TEAM2);
+		PrintScoreboardFor("Pink", "^6", COLOR_TEAM3);
+		PrintScoreboardFor("Yellow", "^3", COLOR_TEAM4);
 	}
 	else
 	{
-		PrintScoreboardFor(0);
+		PrintScoreboardFor("", "^7", 0);
 	}
 	ServerConsoleEcho(".", FALSE);
 }




More information about the nexuiz-commits mailing list