3 #include "command/common.qh"
4 #include "mutators/all.qh"
5 #include "../common/playerstats.qh"
6 #include "../common/teams.qh"
9 entity teamscorekeepers[16];
10 string scores_label[MAX_SCORE];
11 float scores_flags[MAX_SCORE];
12 string teamscores_label[MAX_TEAMSCORE];
13 float teamscores_flags[MAX_TEAMSCORE];
14 float teamscores_entities_count;
15 var .float scores_primary;
16 var .float teamscores_primary;
17 float scores_flags_primary;
18 float teamscores_flags_primary;
20 vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, vector previous, float strict) // returns: cmp value, best prio
22 if(!strict && !(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort
24 if((fieldflags & SFL_SORT_PRIO_MASK) < previous.y)
26 if (t1.(field) == t2.(field))
29 previous.y = fieldflags & SFL_SORT_PRIO_MASK;
31 if(fieldflags & SFL_ZERO_IS_WORST)
38 else if (t2.(field) == 0)
45 if (fieldflags & SFL_LOWER_IS_BETTER)
46 previous.x = (t2.(field) - t1.(field));
48 previous.x = (t1.(field) - t2.(field));
57 bool TeamScore_SendEntity(entity this, entity to, float sendflags)
59 float i, p, longflags;
61 WriteHeader(MSG_ENTITY, ENT_CLIENT_TEAMSCORES);
62 int t = this.team - 1;
63 assert(t, eprint(this));
64 WriteByte(MSG_ENTITY, t);
67 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
68 if(self.(teamscores[i]) > 127 || self.(teamscores[i]) <= -128)
71 #if MAX_TEAMSCORE <= 8
72 WriteByte(MSG_ENTITY, sendflags);
73 WriteByte(MSG_ENTITY, longflags);
75 WriteShort(MSG_ENTITY, sendflags);
76 WriteShort(MSG_ENTITY, longflags);
78 for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
82 WriteInt24_t(MSG_ENTITY, self.(teamscores[i]));
84 WriteChar(MSG_ENTITY, self.(teamscores[i]));
90 void TeamScore_Spawn(float t, string name)
92 entity ts = new_pure(csqc_score_team);
93 ts.netname = name; // not used yet, FIXME
95 Net_LinkEntity(ts, false, 0, TeamScore_SendEntity);
96 teamscorekeepers[t - 1] = ts;
97 ++teamscores_entities_count;
98 PlayerStats_GameReport_AddTeam(t);
101 float TeamScore_AddToTeam(float t, float scorefield, float score)
108 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
109 if(t <= 0 || t >= 16)
113 error("Adding score to invalid team!");
115 s = teamscorekeepers[t - 1];
120 error("Adding score to unknown team!");
123 if(teamscores_label[scorefield] != "")
124 s.SendFlags |= pow(2, scorefield);
125 return (s.(teamscores[scorefield]) += score);
128 float TeamScore_Add(entity player, float scorefield, float score)
130 return TeamScore_AddToTeam(player.team, scorefield, score);
133 float TeamScore_Compare(entity t1, entity t2, float strict)
135 if(!t1 || !t2) return (!t2) - !t1;
137 vector result = '0 0 0';
139 for(i = 0; i < MAX_TEAMSCORE; ++i)
143 result = ScoreField_Compare(t1, t2, f, teamscores_flags[i], result, strict);
146 if (result.x == 0 && strict)
147 result.x = t1.team - t2.team;
153 * the scoreinfo entity
156 void ScoreInfo_SetLabel_PlayerScore(float i, string label, float scoreflags)
158 scores_label[i] = label;
159 scores_flags[i] = scoreflags;
160 if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
162 scores_primary = scores[i];
163 scores_flags_primary = scoreflags;
167 PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
168 PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
172 void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
174 teamscores_label[i] = label;
175 teamscores_flags[i] = scoreflags;
176 if((scoreflags & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
178 teamscores_primary = teamscores[i];
179 teamscores_flags_primary = scoreflags;
183 PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
184 PlayerStats_GameReport_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
188 bool ScoreInfo_SendEntity(entity this, entity to, int sf)
191 WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
192 WriteInt24_t(MSG_ENTITY, MapInfo_LoadedGametype);
193 for(i = 0; i < MAX_SCORE; ++i)
195 WriteString(MSG_ENTITY, scores_label[i]);
196 WriteByte(MSG_ENTITY, scores_flags[i]);
198 for(i = 0; i < MAX_TEAMSCORE; ++i)
200 WriteString(MSG_ENTITY, teamscores_label[i]);
201 WriteByte(MSG_ENTITY, teamscores_flags[i]);
206 void ScoreInfo_Init(float teams)
208 if(scores_initialized)
210 scores_initialized.SendFlags |= 1; // force a resend
214 scores_initialized = new_pure(ent_client_scoreinfo);
215 Net_LinkEntity(scores_initialized, false, 0, ScoreInfo_SendEntity);
218 TeamScore_Spawn(NUM_TEAM_1, "Red");
220 TeamScore_Spawn(NUM_TEAM_2, "Blue");
222 TeamScore_Spawn(NUM_TEAM_3, "Yellow");
224 TeamScore_Spawn(NUM_TEAM_4, "Pink");
228 * per-player score entities
231 bool PlayerScore_SendEntity(entity this, entity to, float sendflags)
233 float i, p, longflags;
235 WriteHeader(MSG_ENTITY, ENT_CLIENT_SCORES);
236 WriteByte(MSG_ENTITY, etof(this.owner));
239 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
240 if(this.(scores[i]) > 127 || this.(scores[i]) <= -128)
244 WriteByte(MSG_ENTITY, sendflags);
245 WriteByte(MSG_ENTITY, longflags);
247 WriteShort(MSG_ENTITY, sendflags);
248 WriteShort(MSG_ENTITY, longflags);
250 for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
254 WriteInt24_t(MSG_ENTITY, this.(scores[i]));
256 WriteChar(MSG_ENTITY, this.(scores[i]));
262 float PlayerScore_Clear(entity player)
267 if(teamscores_entities_count)
270 if(MUTATOR_CALLHOOK(ForbidPlayerScore_Clear)) return 0;
272 sk = player.scorekeeper;
273 for(i = 0; i < MAX_SCORE; ++i)
275 if(sk.(scores[i]) != 0)
276 if(scores_label[i] != "")
277 sk.SendFlags |= pow(2, i);
284 void Score_ClearAll()
288 FOREACH_CLIENTSLOT(true,
293 for(int j = 0; j < MAX_SCORE; ++j)
295 if(sk.(scores[j]) != 0)
296 if(scores_label[j] != "")
297 sk.SendFlags |= pow(2, j);
301 for(t = 0; t < 16; ++t)
303 sk = teamscorekeepers[t];
306 for(int j = 0; j < MAX_TEAMSCORE; ++j)
308 if(sk.(teamscores[j]) != 0)
309 if(teamscores_label[j] != "")
310 sk.SendFlags |= pow(2, j);
311 sk.(teamscores[j]) = 0;
316 void PlayerScore_Attach(entity player)
318 if(player.scorekeeper)
319 error("player already has a scorekeeper");
320 entity sk = new_pure(scorekeeper);
322 Net_LinkEntity(sk, false, 0, PlayerScore_SendEntity);
323 player.scorekeeper = sk;
326 void PlayerScore_Detach(entity player)
328 if(!player.scorekeeper)
329 error("player has no scorekeeper");
330 remove(player.scorekeeper);
331 player.scorekeeper = world;
334 float PlayerScore_Add(entity player, float scorefield, float score)
336 bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score);
340 if(!mutator_returnvalue)
343 if(!scores_initialized) return 0; // FIXME remove this when everything uses this system
344 entity s = player.scorekeeper;
349 LOG_WARNING("Adding score to unknown player!");
353 if(scores_label[scorefield] != "")
354 s.SendFlags |= pow(2, scorefield);
356 PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label[scorefield]), score);
357 return (s.(scores[scorefield]) += score);
360 float PlayerTeamScore_Add(entity player, float pscorefield, float tscorefield, float score)
363 r = PlayerScore_Add(player, pscorefield, score);
364 if(teamscores_entities_count) // only for teamplay
365 r = TeamScore_Add(player, tscorefield, score);
369 float PlayerScore_Compare(entity t1, entity t2, float strict)
371 if(!t1 || !t2) return (!t2) - !t1;
373 vector result = '0 0 0';
375 for(i = 0; i < MAX_SCORE; ++i)
379 result = ScoreField_Compare(t1, t2, f, scores_flags[i], result, strict);
382 if (result.x == 0 && strict)
383 result.x = etof(t1.owner) - etof(t2.owner);
388 void WinningConditionHelper()
394 entity winnerscorekeeper;
395 entity secondscorekeeper;
399 // gametype:P<pure>:S<slots>::plabel,plabel:tlabel,tlabel:teamid:tscore,tscore:teamid:tscore,tscore
400 // score labels always start with a symbol or with lower case
401 // so to match pure, match for :P0:
402 // to match full, match for :S0:
404 fullstatus = autocvar_g_full_getstatus_responses;
407 s = strcat(s, ":", autocvar_g_xonoticversion);
408 s = strcat(s, ":P", ftos(cvar_purechanges_count));
409 s = strcat(s, ":S", ftos(nJoinAllowed(self, world)));
410 s = strcat(s, ":F", ftos(serverflags));
411 s = strcat(s, ":M", modname);
412 s = strcat(s, "::", GetPlayerScoreString(world, (fullstatus ? 1 : 2)));
414 if(teamscores_entities_count)
418 s = strcat(s, ":", GetTeamScoreString(0, 1));
419 for(t = 0; t < 16; ++t)
420 if(teamscorekeepers[t])
421 s = strcat(s, ":", ftos(t+1), ":", GetTeamScoreString(t+1, 1));
423 WinningConditionHelper_winnerteam = -1;
424 WinningConditionHelper_secondteam = -1;
425 winnerscorekeeper = world;
426 secondscorekeeper = world;
427 for(t = 0; t < 16; ++t)
429 sk = teamscorekeepers[t];
430 c = TeamScore_Compare(winnerscorekeeper, sk, 1);
433 WinningConditionHelper_secondteam = WinningConditionHelper_winnerteam;
434 WinningConditionHelper_winnerteam = t + 1;
435 secondscorekeeper = winnerscorekeeper;
436 winnerscorekeeper = sk;
440 c = TeamScore_Compare(secondscorekeeper, sk, 1);
443 WinningConditionHelper_secondteam = t + 1;
444 secondscorekeeper = sk;
449 WinningConditionHelper_equality = (TeamScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
450 if(WinningConditionHelper_equality)
451 WinningConditionHelper_winnerteam = WinningConditionHelper_secondteam = -1;
453 WinningConditionHelper_topscore = winnerscorekeeper.teamscores_primary;
454 WinningConditionHelper_secondscore = secondscorekeeper.teamscores_primary;
455 WinningConditionHelper_lowerisbetter = (teamscores_flags_primary & SFL_LOWER_IS_BETTER);
456 WinningConditionHelper_zeroisworst = (teamscores_flags_primary & SFL_ZERO_IS_WORST);
458 WinningConditionHelper_winner = world; // not supported in teamplay
459 WinningConditionHelper_second = world; // not supported in teamplay
463 WinningConditionHelper_winner = world;
464 WinningConditionHelper_second = world;
465 winnerscorekeeper = world;
466 secondscorekeeper = world;
467 FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
469 c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
472 WinningConditionHelper_second = WinningConditionHelper_winner;
473 WinningConditionHelper_winner = it;
474 secondscorekeeper = winnerscorekeeper;
475 winnerscorekeeper = sk;
479 c = PlayerScore_Compare(secondscorekeeper, sk, 1);
482 WinningConditionHelper_second = it;
483 secondscorekeeper = sk;
488 WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
489 if(WinningConditionHelper_equality)
490 WinningConditionHelper_winner = WinningConditionHelper_second = world;
492 WinningConditionHelper_topscore = winnerscorekeeper.scores_primary;
493 WinningConditionHelper_secondscore = secondscorekeeper.scores_primary;
494 WinningConditionHelper_lowerisbetter = (scores_flags_primary & SFL_LOWER_IS_BETTER);
495 WinningConditionHelper_zeroisworst = (scores_flags_primary & SFL_ZERO_IS_WORST);
497 WinningConditionHelper_winnerteam = -1; // no teamplay
498 WinningConditionHelper_secondteam = -1; // no teamplay
501 if(WinningConditionHelper_topscore == 0)
503 if(scores_flags_primary & SFL_ZERO_IS_WORST)
505 if(WinningConditionHelper_lowerisbetter)
506 WinningConditionHelper_topscore = 999999999;
508 WinningConditionHelper_topscore = -999999999;
510 WinningConditionHelper_equality = 0;
513 if(WinningConditionHelper_secondscore == 0)
515 if(scores_flags_primary & SFL_ZERO_IS_WORST)
517 if(WinningConditionHelper_lowerisbetter)
518 WinningConditionHelper_secondscore = 999999999;
520 WinningConditionHelper_secondscore = -999999999;
525 strunzone(worldstatus);
526 worldstatus = strzone(s);
528 FOREACH_CLIENT(true, LAMBDA(
532 s = GetPlayerScoreString(it, 1);
533 s = strcat(s, IS_REAL_CLIENT(it) ? ":human" : ":bot");
534 ret_string = string_null;
535 if(!IS_PLAYER(it) && !MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
536 s = strcat(s, ":spectator");
537 if (ret_string) s = strcat(s, ret_string);
541 ret_string = string_null;
542 if (IS_PLAYER(it) || MUTATOR_CALLHOOK(GetPlayerStatus, it, s))
543 s = GetPlayerScoreString(it, 2);
546 if (ret_string) s = strcat(s, ret_string);
550 strunzone(it.clientstatus);
551 it.clientstatus = strzone(s);
555 string GetScoreLogLabel(string label, float fl)
557 if(fl & SFL_LOWER_IS_BETTER)
558 label = strcat(label, "<");
559 if((fl & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
560 label = strcat(label, "!!");
561 else if((fl & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
562 label = strcat(label, "!");
566 string GetPlayerScoreString(entity pl, float shortString)
577 for(i = 0; i < MAX_SCORE; ++i)
578 if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
582 out = strcat(out, GetScoreLogLabel(l, f), ",");
585 for(i = 0; i < MAX_SCORE; ++i)
586 if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
590 out = strcat(out, GetScoreLogLabel(l, f), ",");
593 for(i = 0; i < MAX_SCORE; ++i)
594 if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
595 if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
599 out = strcat(out, GetScoreLogLabel(l, f), ",");
601 out = substring(out, 0, strlen(out) - 1);
603 else if((sk = pl.scorekeeper))
605 for(i = 0; i < MAX_SCORE; ++i)
606 if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
607 out = strcat(out, ftos(sk.(scores[i])), ",");
609 for(i = 0; i < MAX_SCORE; ++i)
610 if((scores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
611 out = strcat(out, ftos(sk.(scores[i])), ",");
613 for(i = 0; i < MAX_SCORE; ++i)
614 if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
615 if((scores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
616 out = strcat(out, ftos(sk.(scores[i])), ",");
617 out = substring(out, 0, strlen(out) - 1);
622 string GetTeamScoreString(float tm, float shortString)
633 for(i = 0; i < MAX_TEAMSCORE; ++i)
634 if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
636 f = teamscores_flags[i];
637 l = teamscores_label[i];
638 out = strcat(out, GetScoreLogLabel(l, f), ",");
641 for(i = 0; i < MAX_TEAMSCORE; ++i)
642 if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
644 f = teamscores_flags[i];
645 l = teamscores_label[i];
646 out = strcat(out, GetScoreLogLabel(l, f), ",");
649 for(i = 0; i < MAX_TEAMSCORE; ++i)
650 if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
651 if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
653 f = teamscores_flags[i];
654 l = teamscores_label[i];
655 out = strcat(out, GetScoreLogLabel(l, f), ",");
657 out = substring(out, 0, strlen(out) - 1);
659 else if((sk = teamscorekeepers[tm - 1]))
661 for(i = 0; i < MAX_TEAMSCORE; ++i)
662 if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_PRIMARY)
663 out = strcat(out, ftos(sk.(teamscores[i])), ",");
665 for(i = 0; i < MAX_TEAMSCORE; ++i)
666 if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) == SFL_SORT_PRIO_SECONDARY)
667 out = strcat(out, ftos(sk.(teamscores[i])), ",");
669 for(i = 0; i < MAX_TEAMSCORE; ++i)
670 if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_PRIMARY)
671 if((teamscores_flags[i] & SFL_SORT_PRIO_MASK) != SFL_SORT_PRIO_SECONDARY)
672 out = strcat(out, ftos(sk.(teamscores[i])), ",");
673 out = substring(out, 0, strlen(out) - 1);
678 float PlayerTeamScore_Compare(entity p1, entity p2, float teams, float strict)
680 if(teams && teamscores_entities_count)
682 if(p1.team != p2.team)
686 t1 = teamscorekeepers[p1.team - 1];
687 t2 = teamscorekeepers[p2.team - 1];
688 r = TeamScore_Compare(t1, t2, ((teams >= 0) ? 1 : strict));
695 return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper, strict);
698 entity PlayerScore_Sort(.float field, float teams, float strict, float nospectators)
700 entity p, plist, pprev, pbest, pbestprev, pfirst, plast;
705 FOREACH_CLIENT(true, LAMBDA(it.(field) = 0));
707 FOREACH_CLIENT(it.scorekeeper,
710 if(it.frags == FRAGS_SPECTATOR)
716 // Now plist points to the whole list.
718 pfirst = plast = world;
723 pprev = pbestprev = world;
725 for(p = plist; (pprev = p), (p = p.chain); )
727 if(PlayerTeamScore_Compare(p, pbest, teams, strict) > 0)
734 // remove pbest out of the chain
735 if(pbestprev == world)
738 pbestprev.chain = pbest.chain;
742 if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
757 float TeamScore_GetCompareValue(float t)
762 if(t <= 0 || t >= 16)
766 error("Reading score of invalid team!");
769 sk = teamscorekeepers[t - 1];
772 s = sk.teamscores_primary;
773 if(teamscores_flags_primary & SFL_ZERO_IS_WORST)
776 if(teamscores_flags_primary & SFL_LOWER_IS_BETTER)
781 const float NAMEWIDTH = 22;
782 const float SCORESWIDTH = 58;
783 // TODO put this somewhere in common?
784 string Score_NicePrint_ItemColor(float vflags)
786 if(vflags & SFL_SORT_PRIO_PRIMARY)
788 else if(vflags & SFL_SORT_PRIO_SECONDARY)
794 void Score_NicePrint_Team(entity to, float t, float w)
802 sk = teamscorekeepers[t - 1];
805 s = strcat(s, Team_ColoredFullName(t));
806 for(i = 0; i < MAX_TEAMSCORE; ++i)
807 if(teamscores_label[i] != "")
809 fl = teamscores_flags[i];
810 sc = sk.(teamscores[i]);
811 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), ScoreString(fl, sc));
817 s = strcat(s, strpad(max(0, NAMEWIDTH - strlennocol(s)), ""));
819 for(i = 0; i < MAX_SCORE; ++i)
820 if(scores_label[i] != "")
822 fl = scores_flags[i];
823 s2 = scores_label[i];
824 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, substring(s2, 0, w)));
830 void Score_NicePrint_Player(entity to, entity p, float w)
840 s = strcat(s, p.netname);
843 i = strlennocol(s) - NAMEWIDTH;
845 s = substring(s, 0, strlen(s) - i);
848 s = strcat(s, strpad(i, ""));
853 for(i = 0; i < MAX_SCORE; ++i)
854 if(scores_label[i] != "")
856 fl = scores_flags[i];
858 s = strcat(s, " ", Score_NicePrint_ItemColor(fl), strpad(-w, ScoreString(fl, sc)));
864 void Score_NicePrint_Spectators(entity to)
866 print_to(to, "Spectators:");
869 void Score_NicePrint_Spectator(entity to, entity p)
871 print_to(to, strcat(" ", p.netname));
874 .float score_dummyfield;
875 void Score_NicePrint(entity to)
882 for(i = 0; i < MAX_SCORE; ++i)
883 if(scores_label[i] != "")
885 w = bound(6, floor(SCORESWIDTH / t - 1), 9);
887 p = PlayerScore_Sort(score_dummyfield, 1, 1, 0);
890 if(!teamscores_entities_count)
891 Score_NicePrint_Team(to, t, w);
894 if(teamscores_entities_count)
896 Score_NicePrint_Team(to, p.team, w);
897 Score_NicePrint_Player(to, p, w);
903 FOREACH_CLIENT(!IS_PLAYER(it), LAMBDA(
905 Score_NicePrint_Spectators(to);
906 Score_NicePrint_Spectator(to, it);
911 void PlayerScore_PlayerStats(entity p)
917 for(i = 0; i < MAX_SCORE; ++i)
918 if(s.(scores[i]) != 0)
919 if(scores_label[i] != "")
920 PS_GR_P_ADDVAL(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label[i]), s.(scores[i]));
923 void PlayerScore_TeamStats()
927 for(t = 0; t < 16; ++t)
929 sk = teamscorekeepers[t];
932 for(i = 0; i < MAX_TEAMSCORE; ++i)
933 if(sk.(teamscores[i]) != 0)
934 if(teamscores_label[i] != "")
935 // the +1 is important here!
936 PS_GR_T_ADDVAL(t+1, strcat(PLAYERSTATS_SCOREBOARD, teamscores_label[i]), sk.(teamscores[i]));