- bool unconnected = !playerslots[i].gotscores;
- bool spec = unconnected || stof(getplayerkeyvalue(i, "frags")) == FRAGS_SPECTATOR;
- return (spec) ? NUM_SPECTATOR : GetPlayerColorForce(i);
+ return entcs_IsSpectating(i) ? NUM_SPECTATOR : entcs_GetTeamColor(i);
+ }
+
+ /**
+ * Same as `entcs_GetTeam`, but returns -1 for no team in teamplay
+ */
+ int entcs_GetScoreTeam(int i)
+ {
+ int t = entcs_GetTeam(i);
+ if (teamplay && !t) t = -1;
+ return t;