+ /**
+ * @param i zero indexed player
+ */
+ .int frags;
+ bool entcs_IsSpectating(int i)
+ {
+ bool unconnected = !playerslots[i].gotscores;
+ entity e = entcs_receiver(i);
+ return unconnected || ((e) ? e.frags : stof(getplayerkeyvalue(i, "frags"))) == FRAGS_SPECTATOR;
+ }
+
+ /**
+ * @param i zero indexed player
+ */
+ int entcs_GetClientColors(int i)
+ {
+ entity e = entcs_receiver(i);
+ return e ? e.colormap : stof(getplayerkeyvalue(i, "colors"));
+ }
+
+ /**
+ * @param i zero indexed player
+ * @returns 0 if not teamplay
+ */
+ int entcs_GetTeamColor(int i)
+ {
+ return (!teamplay) ? 0 : entcs_GetClientColors(i) & 15;
+ }
+
+ /**
+ * @param i zero indexed player
+ * @returns 0 if not teamplay | NUM_TEAM_##N | NUM_SPECTATOR
+ */
+ int entcs_GetTeam(int 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;
+ }
+
+ /**
+ * @param i zero indexed player
+ */
+ string entcs_GetName(int i)
+ {
+ entity e = entcs_receiver(i);
+ return ColorTranslateRGB(e ? e.netname : getplayerkeyvalue(i, "name"));
+ }
+
+ /**
+ * @param i zero indexed player
+ */
+ entity CSQCModel_server2csqc(int i);
+
+ .float alpha;
+
+ /**
+ * @param i zero indexed player
+ */
+ float entcs_GetAlpha(int i)
+ {
+ entity e = CSQCModel_server2csqc(i);
+ return e ? e.alpha : 1;
+ }
+
+ /**
+ * @param i zero indexed player
+ */
+ vector entcs_GetColor(int i)
+ {
+ entity e = CSQCModel_server2csqc(i);
+ return (!e || e.colormap <= 0)
+ ? '1 1 1'
+ : colormapPaletteColor(((e.colormap >= 1024)
+ ? e.colormap
+ : entcs_GetClientColors(e.colormap - 1)) & 15, true)
+ ;
+ }
+
+ /**
+ * @param i zero indexed player
+ */
+ bool entcs_IsDead(int i)
+ {
+ entity e = CSQCModel_server2csqc(i);
+ return e ? e.csqcmodel_isdead : false;
+ }