2 entity teamscorekeepers[16];
\r
3 string scores_label[MAX_SCORE];
\r
4 float scores_flags[MAX_SCORE];
\r
5 string teamscores_label[MAX_TEAMSCORE];
\r
6 float teamscores_flags[MAX_TEAMSCORE];
\r
7 float teamscores_entities_count;
\r
8 var .float scores_primary;
\r
9 var .float teamscores_primary;
\r
10 float scores_flags_primary;
\r
11 float teamscores_flags_primary;
\r
13 vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, vector previous) // returns: cmp value, best prio
\r
15 if(!(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort
\r
17 if(fieldflags & SFL_SORT_PRIO_MASK < previous_y)
\r
19 if(t1.field == t2.field)
\r
22 previous_y = fieldflags & SFL_SORT_PRIO_MASK;
\r
24 if(fieldflags & SFL_ZERO_IS_WORST)
\r
31 else if(t2.field == 0)
\r
38 if(fieldflags & SFL_LOWER_IS_BETTER)
\r
39 previous_x = (t2.field - t1.field);
\r
41 previous_x = (t1.field - t2.field);
\r
47 * teamscore entities
\r
50 float TeamScore_SendEntity(entity to, float sendflags)
\r
52 float i, p, longflags;
\r
54 WriteByte(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
\r
55 WriteByte(MSG_ENTITY, self.team - 1);
\r
58 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
\r
59 if(self.teamscores[i] > 127 || self.teamscores[i] <= -128)
\r
62 #if MAX_TEAMSCORE <= 8
\r
63 WriteByte(MSG_ENTITY, sendflags);
\r
64 WriteByte(MSG_ENTITY, longflags);
\r
66 WriteShort(MSG_ENTITY, sendflags);
\r
67 WriteShort(MSG_ENTITY, longflags);
\r
69 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
\r
73 WriteInt24_t(MSG_ENTITY, self.teamscores[i]);
\r
75 WriteChar(MSG_ENTITY, self.teamscores[i]);
\r
81 void TeamScore_Spawn(float t, string name)
\r
85 ts.classname = "csqc_score_team";
\r
86 ts.netname = name; // not used yet, FIXME
\r
88 Net_LinkEntity(ts, FALSE, 0, TeamScore_SendEntity);
\r
89 teamscorekeepers[t - 1] = ts;
\r
90 ++teamscores_entities_count;
\r
93 float TeamScore_AddToTeam(float t, float scorefield, float score)
\r
100 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
\r
101 if(t <= 0 || t >= 16)
\r
105 error("Adding score to invalid team!");
\r
107 s = teamscorekeepers[t - 1];
\r
112 error("Adding score to unknown team!");
\r
115 if(teamscores_label[scorefield] != "")
\r
116 s.SendFlags |= pow(2, scorefield);
\r
117 return (s.(teamscores[scorefield]) += score);
\r
120 float TeamScore_Add(entity player, float scorefield, float score)
\r
122 return TeamScore_AddToTeam(player.team, scorefield, score);
\r
125 float TeamScore_Compare(entity t1, entity t2)
\r
127 if(!t1 || !t2) return (!t2) - !t1;
\r
131 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
135 result = ScoreField_Compare(t1, t2, f, teamscores_flags[i], result);
\r
141 * the scoreinfo entity
\r
144 void ScoreInfo_SetLabel_PlayerScore(float i, string label, float scoreflags)
\r
146 scores_label[i] = label;
\r
147 scores_flags[i] = scoreflags;
\r
148 if(scoreflags & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
\r
150 scores_primary = scores[i];
\r
151 scores_flags_primary = scoreflags;
\r
155 void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
\r
157 teamscores_label[i] = label;
\r
158 teamscores_flags[i] = scoreflags;
\r
159 if(scoreflags & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
\r
161 teamscores_primary = teamscores[i];
\r
162 teamscores_flags_primary = scoreflags;
\r
166 float ScoreInfo_SendEntity(entity to, float sf)
\r
169 WriteByte(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
\r
170 WriteByte(MSG_ENTITY, game);
\r
171 for(i = 0; i < MAX_SCORE; ++i)
\r
173 WriteString(MSG_ENTITY, scores_label[i]);
\r
174 WriteByte(MSG_ENTITY, scores_flags[i]);
\r
176 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
178 WriteString(MSG_ENTITY, teamscores_label[i]);
\r
179 WriteByte(MSG_ENTITY, teamscores_flags[i]);
\r
184 void ScoreInfo_Init(float teams)
\r
186 if(scores_initialized)
\r
188 scores_initialized.SendFlags |= 1; // force a resend
\r
192 scores_initialized = spawn();
\r
193 scores_initialized.classname = "ent_client_scoreinfo";
\r
194 Net_LinkEntity(scores_initialized, FALSE, 0, ScoreInfo_SendEntity);
\r
197 TeamScore_Spawn(COLOR_TEAM1, "Red");
\r
199 TeamScore_Spawn(COLOR_TEAM2, "Blue");
\r
201 TeamScore_Spawn(COLOR_TEAM3, "Yellow");
\r
203 TeamScore_Spawn(COLOR_TEAM4, "Pink");
\r
207 * per-player score entities
\r
210 float PlayerScore_SendEntity(entity to, float sendflags)
\r
212 float i, p, longflags;
\r
214 WriteByte(MSG_ENTITY, ENT_CLIENT_SCORES);
\r
215 WriteByte(MSG_ENTITY, num_for_edict(self.owner));
\r
218 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
\r
219 if(self.scores[i] > 127 || self.scores[i] <= -128)
\r
223 WriteByte(MSG_ENTITY, sendflags);
\r
224 WriteByte(MSG_ENTITY, longflags);
\r
226 WriteShort(MSG_ENTITY, sendflags);
\r
227 WriteShort(MSG_ENTITY, longflags);
\r
229 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
\r
233 WriteInt24_t(MSG_ENTITY, self.scores[i]);
\r
235 WriteChar(MSG_ENTITY, self.scores[i]);
\r
241 void PlayerScore_Clear(entity player)
\r
246 if(teamscores_entities_count)
\r
249 if(g_arena || g_ca) return;
\r
250 if(g_race && !g_race_qualifying) return;
\r
252 sk = player.scorekeeper;
\r
253 for(i = 0; i < MAX_SCORE; ++i)
\r
255 if(sk.(scores[i]) != 0)
\r
256 if(scores_label[i] != "")
\r
257 sk.SendFlags |= pow(2, i);
\r
258 sk.(scores[i]) = 0;
\r
262 void Score_ClearAll()
\r
266 FOR_EACH_CLIENTSLOT(p)
\r
268 sk = p.scorekeeper;
\r
271 for(i = 0; i < MAX_SCORE; ++i)
\r
273 if(sk.(scores[i]) != 0)
\r
274 if(scores_label[i] != "")
\r
275 sk.SendFlags |= pow(2, i);
\r
276 sk.(scores[i]) = 0;
\r
279 for(t = 0; t < 16; ++t)
\r
281 sk = teamscorekeepers[t];
\r
284 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
286 if(sk.(teamscores[i]) != 0)
\r
287 if(teamscores_label[i] != "")
\r
288 sk.SendFlags |= pow(2, i);
\r
289 sk.(teamscores[i]) = 0;
\r
294 void PlayerScore_Attach(entity player)
\r
297 if(player.scorekeeper)
\r
298 error("player already has a scorekeeper");
\r
301 Net_LinkEntity(sk, FALSE, 0, PlayerScore_SendEntity);
\r
302 player.scorekeeper = sk;
\r
305 void PlayerScore_Detach(entity player)
\r
307 if(!player.scorekeeper)
\r
308 error("player has no scorekeeper");
\r
309 remove(player.scorekeeper);
\r
310 player.scorekeeper = world;
\r
313 float PlayerScore_Add(entity player, float scorefield, float score)
\r
318 if not(g_lms && scorefield == SP_LMS_RANK) // allow writing to this field in intermission as it is needed for newly joining players
\r
321 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
\r
322 s = player.scorekeeper;
\r
327 error("Adding score to unknown player!");
\r
330 if(scores_label[scorefield] != "")
\r
331 s.SendFlags |= pow(2, scorefield);
\r
332 return (s.(scores[scorefield]) += score);
\r
335 float PlayerTeamScore_Add(entity player, float pscorefield, float tscorefield, float score)
\r
338 r = PlayerScore_Add(player, pscorefield, score);
\r
339 if(teamscores_entities_count) // only for teamplay
\r
340 r = TeamScore_Add(player, tscorefield, score);
\r
344 float PlayerScore_Compare(entity t1, entity t2)
\r
346 if(!t1 || !t2) return (!t2) - !t1;
\r
350 for(i = 0; i < MAX_SCORE; ++i)
\r
354 result = ScoreField_Compare(t1, t2, f, scores_flags[i], result);
\r
359 void WinningConditionHelper()
\r
365 entity winnerscorekeeper;
\r
366 entity secondscorekeeper;
\r
370 s = strcat(s, ":", cvar_string("g_voretournamentversion"));
\r
371 s = strcat(s, "::", GetPlayerScoreString(world, 2)); // make this 1 once we can
\r
373 fullstatus = cvar("g_full_getstatus_responses");
\r
375 if(teamscores_entities_count)
\r
379 s = strcat(s, ":", GetTeamScoreString(0, 1));
\r
380 for(t = 0; t < 16; ++t)
\r
381 if(teamscorekeepers[t])
\r
382 s = strcat(s, ":", ftos(t+1), ":", GetTeamScoreString(t+1, 1));
\r
384 WinningConditionHelper_winnerteam = -1;
\r
385 WinningConditionHelper_secondteam = -1;
\r
386 winnerscorekeeper = world;
\r
387 secondscorekeeper = world;
\r
388 for(t = 0; t < 16; ++t)
\r
390 sk = teamscorekeepers[t];
\r
391 c = TeamScore_Compare(winnerscorekeeper, sk);
\r
394 WinningConditionHelper_secondteam = WinningConditionHelper_winnerteam;
\r
395 WinningConditionHelper_winnerteam = t + 1;
\r
396 secondscorekeeper = winnerscorekeeper;
\r
397 winnerscorekeeper = sk;
\r
401 c = TeamScore_Compare(secondscorekeeper, sk);
\r
404 WinningConditionHelper_secondteam = t + 1;
\r
405 secondscorekeeper = sk;
\r
410 WinningConditionHelper_equality = (TeamScore_Compare(winnerscorekeeper, secondscorekeeper) == 0);
\r
411 if(WinningConditionHelper_equality)
\r
412 WinningConditionHelper_winnerteam = WinningConditionHelper_secondteam = -1;
\r
414 WinningConditionHelper_topscore = winnerscorekeeper.teamscores_primary;
\r
415 WinningConditionHelper_secondscore = secondscorekeeper.teamscores_primary;
\r
416 WinningConditionHelper_lowerisbetter = (teamscores_flags_primary & SFL_LOWER_IS_BETTER);
\r
417 WinningConditionHelper_zeroisworst = (teamscores_flags_primary & SFL_ZERO_IS_WORST);
\r
419 WinningConditionHelper_winner = world; // not supported in teamplay
\r
420 WinningConditionHelper_second = world; // not supported in teamplay
\r
424 WinningConditionHelper_winner = world;
\r
425 WinningConditionHelper_second = world;
\r
426 winnerscorekeeper = world;
\r
427 secondscorekeeper = world;
\r
430 sk = p.scorekeeper;
\r
431 c = PlayerScore_Compare(winnerscorekeeper, sk);
\r
434 WinningConditionHelper_second = WinningConditionHelper_winner;
\r
435 WinningConditionHelper_winner = p;
\r
436 secondscorekeeper = winnerscorekeeper;
\r
437 winnerscorekeeper = sk;
\r
441 c = PlayerScore_Compare(secondscorekeeper, sk);
\r
444 WinningConditionHelper_second = p;
\r
445 secondscorekeeper = sk;
\r
450 WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper) == 0);
\r
451 if(WinningConditionHelper_equality)
\r
452 WinningConditionHelper_winner = WinningConditionHelper_second = world;
\r
454 WinningConditionHelper_topscore = winnerscorekeeper.scores_primary;
\r
455 WinningConditionHelper_secondscore = secondscorekeeper.scores_primary;
\r
456 WinningConditionHelper_lowerisbetter = (scores_flags_primary & SFL_LOWER_IS_BETTER);
\r
457 WinningConditionHelper_zeroisworst = (scores_flags_primary & SFL_ZERO_IS_WORST);
\r
459 WinningConditionHelper_winnerteam = -1; // no teamplay
\r
460 WinningConditionHelper_secondteam = -1; // no teamplay
\r
463 if(WinningConditionHelper_topscore == 0)
\r
465 if(scores_flags_primary & SFL_ZERO_IS_WORST)
\r
467 if(WinningConditionHelper_lowerisbetter)
\r
468 WinningConditionHelper_topscore = 999999999;
\r
470 WinningConditionHelper_topscore = -999999999;
\r
472 WinningConditionHelper_equality = 0;
\r
475 if(WinningConditionHelper_secondscore == 0)
\r
477 if(scores_flags_primary & SFL_ZERO_IS_WORST)
\r
479 if(WinningConditionHelper_lowerisbetter)
\r
480 WinningConditionHelper_secondscore = 999999999;
\r
482 WinningConditionHelper_secondscore = -999999999;
\r
487 strunzone(worldstatus);
\r
488 worldstatus = strzone(s);
\r
494 s = GetPlayerScoreString(p, 1);
\r
495 if(clienttype(p) == CLIENTTYPE_REAL)
\r
496 s = strcat(s, ":human");
\r
498 s = strcat(s, ":bot");
\r
499 if(p.classname != "player" && !g_arena && !g_ca && !g_lms)
\r
500 s = strcat(s, ":spectator");
\r
504 if(p.classname == "player" || g_arena || g_ca || g_lms)
\r
505 s = GetPlayerScoreString(p, 2);
\r
511 strunzone(p.clientstatus);
\r
512 p.clientstatus = strzone(s);
\r
516 string GetScoreLogLabel(string label, float fl)
\r
518 if(fl & SFL_LOWER_IS_BETTER)
\r
519 label = strcat(label, "<");
\r
520 if(fl & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
\r
521 label = strcat(label, "!!");
\r
522 else if(fl & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
\r
523 label = strcat(label, "!");
\r
527 string GetPlayerScoreString(entity pl, float shortString)
\r
538 for(i = 0; i < MAX_SCORE; ++i)
\r
539 if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
\r
541 f = scores_flags[i];
\r
542 l = scores_label[i];
\r
543 out = strcat(out, GetScoreLogLabel(l, f), ",");
\r
545 if(shortString < 2)
\r
546 for(i = 0; i < MAX_SCORE; ++i)
\r
547 if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
\r
549 f = scores_flags[i];
\r
550 l = scores_label[i];
\r
551 out = strcat(out, GetScoreLogLabel(l, f), ",");
\r
553 if(shortString < 1)
\r
554 for(i = 0; i < MAX_SCORE; ++i)
\r
555 if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
\r
556 if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
\r
558 f = scores_flags[i];
\r
559 l = scores_label[i];
\r
560 out = strcat(out, GetScoreLogLabel(l, f), ",");
\r
562 out = substring(out, 0, strlen(out) - 1);
\r
564 else if((sk = pl.scorekeeper))
\r
566 for(i = 0; i < MAX_SCORE; ++i)
\r
567 if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
\r
568 out = strcat(out, ftos(sk.(scores[i])), ",");
\r
569 if(shortString < 2)
\r
570 for(i = 0; i < MAX_SCORE; ++i)
\r
571 if(scores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
\r
572 out = strcat(out, ftos(sk.(scores[i])), ",");
\r
573 if(shortString < 1)
\r
574 for(i = 0; i < MAX_SCORE; ++i)
\r
575 if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
\r
576 if(scores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
\r
577 out = strcat(out, ftos(sk.(scores[i])), ",");
\r
578 out = substring(out, 0, strlen(out) - 1);
\r
583 string GetTeamScoreString(float tm, float shortString)
\r
594 for(i = 0; i < MAX_SCORE; ++i)
\r
595 if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
\r
597 f = teamscores_flags[i];
\r
598 l = teamscores_label[i];
\r
599 out = strcat(out, GetScoreLogLabel(l, f), ",");
\r
601 if(shortString < 2)
\r
602 for(i = 0; i < MAX_SCORE; ++i)
\r
603 if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
\r
605 f = teamscores_flags[i];
\r
606 l = teamscores_label[i];
\r
607 out = strcat(out, GetScoreLogLabel(l, f), ",");
\r
609 if(shortString < 1)
\r
610 for(i = 0; i < MAX_SCORE; ++i)
\r
611 if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
\r
612 if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
\r
614 f = teamscores_flags[i];
\r
615 l = teamscores_label[i];
\r
616 out = strcat(out, GetScoreLogLabel(l, f), ",");
\r
618 out = substring(out, 0, strlen(out) - 1);
\r
620 else if((sk = teamscorekeepers[tm - 1]))
\r
622 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
623 if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_PRIMARY)
\r
624 out = strcat(out, ftos(sk.(teamscores[i])), ",");
\r
625 if(shortString < 2)
\r
626 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
627 if(teamscores_flags[i] & SFL_SORT_PRIO_MASK == SFL_SORT_PRIO_SECONDARY)
\r
628 out = strcat(out, ftos(sk.(teamscores[i])), ",");
\r
629 if(shortString < 1)
\r
630 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
631 if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_PRIMARY)
\r
632 if(teamscores_flags[i] & SFL_SORT_PRIO_MASK != SFL_SORT_PRIO_SECONDARY)
\r
633 out = strcat(out, ftos(sk.(teamscores[i])), ",");
\r
634 out = substring(out, 0, strlen(out) - 1);
\r
639 float PlayerTeamScore_Compare(entity p1, entity p2)
\r
641 if(teamscores_entities_count)
\r
642 if(p1.team != p2.team)
\r
646 t1 = teamscorekeepers[p1.team - 1];
\r
647 t2 = teamscorekeepers[p2.team - 1];
\r
648 r = TeamScore_Compare(t1, t2);
\r
649 if(r == 0) // ensure a deterministic order
\r
650 r = p1.team - p2.team;
\r
654 return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper);
\r
657 entity PlayerScore_Sort(.float field)
\r
659 entity p, plist, pprev, pbest, pbestprev, pfirst, plast;
\r
667 FOR_EACH_PLAYER(p) if(p.scorekeeper)
\r
672 // Now plist points to the whole list.
\r
674 pfirst = plast = world;
\r
679 pprev = pbestprev = world;
\r
681 for(p = plist; (pprev = p), (p = p.chain); )
\r
683 if(PlayerTeamScore_Compare(p, pbest) > 0)
\r
690 // remove pbest out of the chain
\r
691 if(pbestprev == world)
\r
692 plist = pbest.chain;
\r
694 pbestprev.chain = pbest.chain;
\r
695 pbest.chain = world;
\r
702 plast.chain = pbest;
\r
709 float TeamScore_GetCompareValue(float t)
\r
714 if(t <= 0 || t >= 16)
\r
718 error("Reading score of invalid team!");
\r
721 sk = teamscorekeepers[t - 1];
\r
724 s = sk.teamscores_primary;
\r
725 if(teamscores_flags_primary & SFL_ZERO_IS_WORST)
\r
728 if(teamscores_flags_primary & SFL_LOWER_IS_BETTER)
\r
733 #define NAMEWIDTH 22
\r
734 #define SCORESWIDTH 58
\r
735 // TODO put this somewhere in common?
\r
736 string Score_NicePrint_ItemColor(float vflags)
\r
738 if(vflags & SFL_SORT_PRIO_PRIMARY)
\r
740 else if(vflags & SFL_SORT_PRIO_SECONDARY)
\r
746 void Score_NicePrint_Team(entity to, float t, float w)
\r
754 sk = teamscorekeepers[t - 1];
\r
757 s = strcat(s, ColoredTeamName(t));
\r
758 for(i = 0; i < MAX_TEAMSCORE; ++i)
\r
759 if(teamscores_label[i] != "")
\r
761 fl = teamscores_flags[i];
\r
762 sc = sk.(teamscores[i]);
\r
763 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), ScoreString(fl, sc));
\r
769 s = strcat(s, strpad(max(0, NAMEWIDTH - strlennocol(s)), ""));
\r
771 for(i = 0; i < MAX_SCORE; ++i)
\r
772 if(scores_label[i] != "")
\r
774 fl = scores_flags[i];
\r
775 s2 = scores_label[i];
\r
776 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, substring(s2, 0, w)));
\r
782 void Score_NicePrint_Player(entity to, entity p, float w)
\r
790 sk = p.scorekeeper;
\r
792 s = strcat(s, p.netname);
\r
795 i = strlennocol(s) - NAMEWIDTH;
\r
797 s = substring(s, 0, strlen(s) - i);
\r
800 s = strcat(s, strpad(i, ""));
\r
805 for(i = 0; i < MAX_SCORE; ++i)
\r
806 if(scores_label[i] != "")
\r
808 fl = scores_flags[i];
\r
809 sc = sk.(scores[i]);
\r
810 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, ScoreString(fl, sc)));
\r
816 void Score_NicePrint_Spectators(entity to)
\r
818 print_to(to, "Spectators:");
\r
821 void Score_NicePrint_Spectator(entity to, entity p)
\r
823 print_to(to, strcat(" ", p.netname));
\r
826 .float score_dummyfield;
\r
827 void Score_NicePrint(entity to)
\r
834 for(i = 0; i < MAX_SCORE; ++i)
\r
835 if(scores_label[i] != "")
\r
837 w = bound(6, floor(SCORESWIDTH / t - 1), 9);
\r
839 p = PlayerScore_Sort(score_dummyfield);
\r
842 if(!teamscores_entities_count)
\r
843 Score_NicePrint_Team(to, t, w);
\r
846 if(teamscores_entities_count)
\r
848 Score_NicePrint_Team(to, p.team, w);
\r
849 Score_NicePrint_Player(to, p, w);
\r
856 if(p.classname != "player")
\r
859 Score_NicePrint_Spectators(to);
\r
860 Score_NicePrint_Spectator(to, p);
\r