if(spectatee_status == -1)
s = sprintf(_("^1Press ^3%s^1 to spectate"), getcommandkey("primary fire", "+fire"));
else
- s = sprintf(_("^1Press ^3%s^1 for another player"), getcommandkey("primary fire", "+fire"));
+ s = sprintf(_("^1Press ^3%s^1 or ^3%s^1 for next or previous player"), getcommandkey("next weapon", "weapnext"), getcommandkey("previous weapon", "weapprev"));
drawInfoMessage(s)
if(spectatee_status == -1)
return setSpectator();
}
+float SpectatePrev()
+{
+ // NOTE: chain order is from the highest to the lower entnum (unlike find)
+ other = findchain(classname, "player");
+ if not(other) // no player
+ return FALSE;
+
+ entity first = other;
+ // skip players until current spectated player
+ if(self.enemy)
+ while(other && other != self.enemy)
+ other = other.chain;
+
+ if (g_ca && !autocvar_g_ca_spectate_enemies && self.caplayer)
+ {
+ do { other = other.chain; }
+ while(other && other.team != self.team);
+
+ if not(other)
+ {
+ other = first;
+ while(other.team != self.team)
+ other = other.chain;
+ if(other == self.enemy)
+ return TRUE;
+ }
+ }
+ else
+ {
+ if(other.chain)
+ other = other.chain;
+ else
+ other = first;
+ }
+ self.enemy = other;
+ return setSpectator();
+}
+
/*
=============
ShowRespawnCountdown()
if (self.BUTTON_JUMP && !self.version_mismatch) {
self.flags &~= FL_JUMPRELEASED;
self.flags |= FL_SPAWNING;
- } else if(self.BUTTON_ATCK) {
+ } else if(self.BUTTON_ATCK || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || self.impulse >= 200 && self.impulse <= 209) {
self.flags &~= FL_JUMPRELEASED;
if(SpectateNext()) {
self.classname = "spectator";
self.classname = "observer";
PutClientInServer();
}
+ self.impulse = 0;
+ } else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19 || self.impulse >= 220 && self.impulse <= 229) {
+ self.flags &~= FL_JUMPRELEASED;
+ if(SpectatePrev()) {
+ self.classname = "spectator";
+ } else {
+ self.classname = "observer";
+ PutClientInServer();
+ }
+ self.impulse = 0;
} else if (self.BUTTON_ATCK2) {
self.flags &~= FL_JUMPRELEASED;
self.classname = "observer";