View Single Post
Violet CLM

JCF Éminence Grise

Joined: Mar 2001

Posts: 11,047

Violet CLM has disabled reputation

Apr 13, 2015, 10:36 AM
Violet CLM is offline
Reply With Quote
I'd try something like this (untested), if you're sure there'll be a time limit (maybe put some code in onLevelBegin to ensure that):
Code:
bool atLeastOneRedPlayerAlive() {
  for (uint i = 0; i < 32; ++i) {
    jjPLAYER@ play = jjPlayers[i];
    if (play.team == TEAM::RED && play.isInGame)
      return true;
  }
  return false;
}
void onGameStop(bool firstTime) {
  if (!jjIsServer) return;
  if (firstTime) return;
  if (jjGameState == GAME::PAUSED) return;
  if (atLeastOneRedPlayerAlive())
    //somehow indicate that you think blue lost
}
__________________