}
}
+ // add information about respawn status
+ float respawn_time = getstatf(STAT_RESPAWN_SCHEDULE);
+ if(respawn_time)
+ {
+ if(respawn_time < 0)
+ {
+ // a negative value means we are awaiting respawn, time value is still the same
+ respawn_time *= -1; // remove our mark now that we checked it
+ str = strcat(str, "\n\nRespawning in ", ftos(respawn_time - time), " seconds...");
+ }
+ else if(time < respawn_time)
+ {
+ str = strcat(str, "\n\nYou are dead, wait ", ftos(respawn_time - time), " seconds before respawning");
+ }
+ else if(time >= respawn_time)
+ {
+ str = strcat(str, "\n\nYou are dead, press fire to respawn");
+ }
+ }
pos_y += 1.2 * hud_fontsize_y;
drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - stringwidth(str, TRUE, hud_fontsize)), str, hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
const float STAT_SECRETS_TOTAL = 70;
const float STAT_SECRETS_FOUND = 71;
+const float STAT_RESPAWN_SCHEDULE = 72;
+
// mod stats (1xx)
const float STAT_REDALIVE = 100;
const float STAT_BLUEALIVE = 101;
self.damageforcescale = 0;
self.death_time = 0;
self.respawn_time = 0;
+ self.respawn_schedule = 0;
self.alpha = 0;
self.scale = 0;
self.fade_time = 0;
self.damageforcescale = 2;
self.death_time = 0;
self.respawn_time = 0;
+ self.respawn_schedule = 0;
self.scale = 0;
self.fade_time = 0;
self.pain_frame = 0;
}
ShowRespawnCountdown();
}
+
+ if(self.respawn_schedule != self.respawn_time)
+ self.respawn_schedule = self.respawn_time;
+ if(self.deadflag == DEAD_RESPAWNING && self.respawn_schedule > 0)
+ self.respawn_schedule *= -1; // invert to indicate we're awaiting respawn, the client translates this
+
return;
}
// FIXME from now on self.deadflag is always 0 (and self.health is never < 1)
.entity muzzle_flash;
.float misc_bulletcounter; // replaces uzi & hlac bullet counter.
+.float respawn_schedule; // shows respawn time, and is negative when awaiting respawn
+
void PlayerUseKey();
typedef vector(entity player, entity spot, vector current) spawn_evalfunc_t;
// secrets
addstat(STAT_SECRETS_TOTAL, AS_FLOAT, stat_secrets_total);
addstat(STAT_SECRETS_FOUND, AS_FLOAT, stat_secrets_found);
+
+ // misc
+ addstat(STAT_RESPAWN_SCHEDULE, AS_FLOAT, respawn_schedule);
next_pingtime = time + 5;