vector distribution_color;
entity tm, pl, me;
- me = playerslots[player_localentnum - 1];
+ me = playerslots[current_player];
if((scores_flags[ps_primary] & SFL_TIME) && !teamplay) { // race/cts record display on HUD
string timer, distrtimer;
if(spectatee_status == -1)
s = _("^1Observing");
else
- s = sprintf(_("^1Spectating: ^7%s"), GetPlayerName(player_localentnum - 1));
+ s = sprintf(_("^1Spectating: ^7%s"), GetPlayerName(current_player));
drawInfoMessage(s);
if(spectatee_status == -1)
hud_skin_prev = strzone(autocvar_hud_skin);
}
- current_player = player_localentnum;
-
// draw the dock
if(autocvar_hud_dock != "" && autocvar_hud_dock != "0")
{
{
string hud_dock_color = autocvar_hud_dock_color;
if(hud_dock_color == "shirt") {
- f = stof(getplayerkeyvalue(current_player - 1, "colors"));
+ f = stof(getplayerkeyvalue(current_player, "colors"));
color = colormapPaletteColor(floor(f / 16), 0);
}
else if(hud_dock_color == "pants") {
- f = stof(getplayerkeyvalue(current_player - 1, "colors"));
+ f = stof(getplayerkeyvalue(current_player, "colors"));
color = colormapPaletteColor(f % 16, 1);
}
else
panel_bg_color = autocvar_hud_panel_bg_color; \
} else { \
if (panel_bg_color_str == "shirt") { \
- panel_bg_color = colormapPaletteColor(floor(stof(getplayerkeyvalue(current_player - 1, "colors")) / 16), 0);\
+ panel_bg_color = colormapPaletteColor(floor(stof(getplayerkeyvalue(current_player, "colors")) / 16), 0); \
} else if (panel_bg_color_str == "pants") { \
- panel_bg_color = colormapPaletteColor(stof(getplayerkeyvalue(current_player - 1, "colors")) % 16, 1);\
+ panel_bg_color = colormapPaletteColor(stof(getplayerkeyvalue(current_player, "colors")) % 16, 1); \
} else { \
panel_bg_color = stov(panel_bg_color_str); \
} \
CSQCPlayer_SetCamera();
- myteam = GetPlayerColor(player_localentnum - 1);
+ if(player_localentnum <= maxclients) // is it a client?
+ current_player = player_localentnum - 1;
+ else // then player_localentnum is the vehicle I'm driving
+ current_player = player_localnum;
+ myteam = GetPlayerColor(current_player);
if(myteam != prev_myteam)
{