pos_y += 1.2 * sbar_fontsize_y;\r
drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
\r
+ // print information about respawn status\r
+ float respawn_time = getstatf(STAT_RESPAWN_TIME);\r
+ dprint(strcat(ftos(respawn_time), " --------\n"));\r
+ if(respawn_time)\r
+ {\r
+ if(respawn_time < 0)\r
+ {\r
+ // a negative number means we are awaiting respawn, time value is still the same\r
+ respawn_time *= -1; // remove mark now that we checked it\r
+ if(time >= respawn_time) // don't show a negative value while the server is respawning the player (lag)\r
+ str = strcat("^1Respawning...");\r
+ else\r
+ str = strcat("^1Respawning in ^3", ftos_decimals(respawn_time - time, 2), "^1 seconds...");\r
+ }\r
+ else if(time < respawn_time)\r
+ str = strcat("You are dead, wait ^3", ftos_decimals(respawn_time - time, 2), "^7 seconds before respawning");\r
+ else if(time >= respawn_time)\r
+ str = strcat("You are dead, press ^2", getcommandkey("primary fire", "+fire"), "^7 to respawn");\r
+\r
+ pos_y += 1.2 * sbar_fontsize_y;\r
+ drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, sbar_fontsize)), str, sbar_fontsize, sbar_scoreboard_alpha_fg, DRAWFLAG_NORMAL);\r
+ }\r
+\r
scoreboard_bottom = pos_y + 2 * sbar_fontsize_y;\r
}\r
\r
const float STAT_SBRING1_CLIP = 62;\r
const float STAT_SBRING2_TYPE = 63;\r
const float STAT_SBRING2_CLIP = 64;\r
-const float STAT_HUD = 65;\r
+const float STAT_RESPAWN_TIME = 65;\r
+const float STAT_HUD = 66;\r
const float HUD_NORMAL = 0;\r
const float CTF_STATE_ATTACK = 1;\r
const float CTF_STATE_DEFEND = 2;\r
self.stat_sbring1_clip = spectatee.stat_sbring1_clip;\r
self.stat_sbring2_type = spectatee.stat_sbring2_type;\r
self.stat_sbring2_clip = spectatee.stat_sbring2_clip;\r
+ self.stat_respawn_time = spectatee.stat_respawn_time;\r
setorigin(self, spectatee.origin);\r
setsize(self, spectatee.mins, spectatee.maxs);\r
SetZoomState(spectatee.zoomstate);\r
self.stat_allow_oldnexbeam = cvar("g_allow_oldnexbeam");\r
self.stat_leadlimit = cvar("leadlimit");\r
\r
+ if(g_arena || (g_ca && !allowed_to_spawn))\r
+ self.stat_respawn_time = 0;\r
+ else\r
+ self.stat_respawn_time = self.death_time;\r
+\r
if(frametime)\r
{\r
// physics frames: update anticheat stuff\r
}\r
ShowRespawnCountdown();\r
}\r
+\r
+ // if respawning, invert stat_respawn_time to indicate this, the client translates it\r
+ if(self.deadflag == DEAD_RESPAWNING && self.stat_respawn_time > 0)\r
+ self.stat_respawn_time *= -1;\r
+\r
return;\r
}\r
\r
\r
.float stat_leadlimit;\r
\r
+.float stat_respawn_time; // shows respawn time, and is negative when awaiting respawn\r
+\r
#ifdef PROFILING\r
float client_cefc_accumulator;\r
float client_cefc_accumulatortime;\r
addstat(STAT_SBRING1_CLIP, AS_FLOAT, stat_sbring1_clip);\r
addstat(STAT_SBRING2_TYPE, AS_INT, stat_sbring2_type);\r
addstat(STAT_SBRING2_CLIP, AS_FLOAT, stat_sbring2_clip);\r
+ addstat(STAT_RESPAWN_TIME, AS_FLOAT, stat_respawn_time);\r
next_pingtime = time + 5;\r
InitializeEntity(self, cvar_changes_init, INITPRIO_CVARS);\r
\r