Code: Show/Hide case EVENT_Tick:
{ if (countdown[0] == 0) { // assuming countdown[0] initialized to > 0 in spawn.h, freqchange=0; _listnode <Player> *parse = playerlist->head; int count = 0; while (parse) { Player *p = parse->item; if (p->ship != SHIP_Spectator) ++count; parse = parse->next; } if ((count = 4) && (freqchange != 2)) { sendPublic("?set team:maxperteam:2"); sendPublic("*lock"); String s; s = "Max freq size 2 ("; s += count; s += " pilots in game)"; sendPublic(s); sendPublic("Game will start in 10 seconds..."); freqchange = 2; countdown[1] = 10; } countdown[0] = 5; } if(countdown[1] == 0) { //Starts game //Warps players } } break; |
Code: Show/Hide // warps players
bool warped_freq0_player = false; bool warped_freq1_player = false; _listnode <Player> *parse = playerlist->head; while (parse) { Player *p = parse->item; if (p->team == 0) { if (warped_freq0_player) sendPrivate(p, "*warpto 534 488"); else { sendPrivate(p, "*warpto 497 488"); warped_freq0_player = true; } } else if (p->team == 1) { if (warped_freq1_player) sendPrivate(p, "*warpto 534 532"); else { sendPrivate(p, "*warpto 497 532"); warped_freq1_player = true; } } parse = parse->next; } |