| 400 | } |
| 401 | |
| 402 | void killPlayers(int safeid, std::string kothcallsign) { |
| 403 | bz_APIIntList* playerList = bz_newIntList(); |
| 404 | bz_getPlayerIndexList(playerList); |
| 405 | |
| 406 | for (unsigned int i = 0; i < playerList->size(); i++) { |
| 407 | |
| 408 | bz_BasePlayerRecord* player = bz_getPlayerByIndex(playerList->operator[](i)); |
| 409 | |
| 410 | if (player) { |
| 411 | |
| 412 | if (player->playerID != safeid) { |
| 413 | bz_killPlayer(player->playerID, true, koth.id); |
| 414 | if (koth.soundEnabled) { |
| 415 | bz_sendPlayCustomLocalSound(player->playerID, "flag_lost"); |
| 416 | } |
| 417 | } |
| 418 | else if (koth.soundEnabled) { |
| 419 | bz_sendPlayCustomLocalSound(player->playerID, "flag_won"); |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | bz_freePlayerRecord(player); |
| 424 | } |
| 425 | |
| 426 | bz_deleteIntList(playerList); |
| 427 | |
| 428 | bz_sendTextMessagef(BZ_SERVER, BZ_ALLUSERS, "%s IS KING OF THE HILL!", kothcallsign.c_str()); |
| 429 | |
| 430 | return; |
| 431 | } |
| 432 | |
| 433 | void sendWarnings(const char* teamcolor, std::string playercallsign, double kothstartedtime) { |
| 434 | double TimeElapsed = bz_getCurrentTime() - kothstartedtime; |
no test coverage detected