sbt_field_icon2_rgb = colormapPaletteColor(f % 16, 1);
}
}
-
- return entcs_GetName(pl.sv_entnum);
+ if(entcs_GetRank(pl.sv_entnum) != "")
+ return strcat(entcs_GetRank(pl.sv_entnum), "^7 ", entcs_GetName(pl.sv_entnum));
+ else
+ return entcs_GetName(pl.sv_entnum);
}
//LegendGuard adds GetCountrycode function 05-04-2021
void HUD_SpectHUD_drawCurrentName(vector pos)
{
vector tmp;
+ string s;
tmp = pos;
- string s = entcs_GetName(current_player);
+
+ s = entcs_GetName(current_player);
tmp.x -= stringwidth_colors(s, hud_fontsize * 2) / 2;
drawcolorcodedstring(tmp, s, hud_fontsize * 2, panel_fg_alpha, DRAWFLAG_NORMAL);
-
+
tmp = pos;
- s = "Spectating";
+ s = (entcs_GetRank(current_player) != "" ? entcs_GetRank(current_player) : "Spectating");
tmp.x -= stringwidth_colors(s, hud_fontsize) / 2;
tmp.y -= hud_fontsize.y;
drawcolorcodedstring(tmp, s, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
}
// Get player's name
- playername = textShortenToWidth(entcs_GetName(pl.sv_entnum), line_sz.x * 0.8, hud_fontsize, stringwidth_colors);
+ string playername;
+ if(entcs_GetRank(pl.sv_entnum) != "")
+ playername = strcat(entcs_GetRank(pl.sv_entnum), "^7 ", entcs_GetName(pl.sv_entnum));
+ else
+ playername = entcs_GetName(pl.sv_entnum);
+
+ playername = textShortenToWidth(playername, line_sz.x * 0.8, hud_fontsize, stringwidth_colors);
// Draw health and name
drawfill(pos, line_sz, rgb * 0.7, a * 0.3, DRAWFLAG_NORMAL);