| 370 | } |
| 371 | |
| 372 | void killTeams(bz_eTeamType safeteam, std::string kothcallsign) { |
| 373 | bz_APIIntList* playerList = bz_newIntList(); |
| 374 | bz_getPlayerIndexList(playerList); |
| 375 | |
| 376 | for (unsigned int i = 0; i < playerList->size(); i++) { |
| 377 | |
| 378 | bz_BasePlayerRecord* player = bz_getPlayerByIndex(playerList->operator[](i)); |
| 379 | |
| 380 | if (player) { |
| 381 | |
| 382 | if (player->team != safeteam) { |
| 383 | bz_killPlayer(player->playerID, true, BZ_SERVER); |
| 384 | if (koth.soundEnabled) { |
| 385 | bz_sendPlayCustomLocalSound(player->playerID, "flag_lost"); |
| 386 | } |
| 387 | } |
| 388 | else if (koth.soundEnabled) { |
| 389 | bz_sendPlayCustomLocalSound(player->playerID, "flag_won"); |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | bz_freePlayerRecord(player); |
| 394 | } |
| 395 | bz_deleteIntList(playerList); |
| 396 | |
| 397 | bz_sendTextMessagef(BZ_SERVER, BZ_ALLUSERS, "%s (%s) IS KING OF THE HILL!", getTeamColor(safeteam), kothcallsign.c_str()); |
| 398 | |
| 399 | return; |
| 400 | } |
| 401 | |
| 402 | void killPlayers(int safeid, std::string kothcallsign) { |
| 403 | bz_APIIntList* playerList = bz_newIntList(); |
no test coverage detected