From 6c135a52e42ab715a7142c5f82c93bf8fc46d8bc Mon Sep 17 00:00:00 2001 From: tilgep Date: Tue, 26 May 2026 16:02:58 +0100 Subject: [PATCH 1/2] Add !motherzombies command --- src/zombiereborn.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/zombiereborn.cpp b/src/zombiereborn.cpp index 00de8278..48be3cfb 100644 --- a/src/zombiereborn.cpp +++ b/src/zombiereborn.cpp @@ -56,6 +56,7 @@ static bool g_bRespawnEnabled = true; static CHandle g_hRespawnToggler; static CHandle g_hTeamCT; static CHandle g_hTeamT; +std::vector g_MotherZombies; CZRPlayerClassManager* g_pZRPlayerClassManager = nullptr; ZRWeaponConfig* g_pZRWeaponConfig = nullptr; @@ -911,6 +912,8 @@ void ZR_OnRoundPrestart(IGameEvent* pEvent) if (pPawn) pPawn->m_bTakesDamage = false; } + + g_MotherZombies.clear(); } void SetupRespawnToggler() @@ -1258,6 +1261,8 @@ void ZR_InfectMotherZombie(CCSPlayerController* pVictimController, std::vectorGetHandle(); CTimer::Create(rand() % (int)g_cvarMoanInterval.Get(), TIMERFLAG_MAP | TIMERFLAG_ROUND, [hPlayer]() { return ZR_MoanTimer(hPlayer); }); + + g_MotherZombies.push_back(hPlayer); } // make players who've been picked as MZ recently less likely to be picked again @@ -2073,4 +2078,43 @@ CON_COMMAND_CHAT_FLAGS(revive, "- Revive a player", ADMFLAG_GENERIC) } if (iNumClients > 1) PrintMultiAdminAction(nType, strCommandPlayerName, "revived", "", ZR_PREFIX); +} + +CON_COMMAND_CHAT(motherzombies, "- Print the current motherzombies to chat") +{ + if (g_ZRRoundState == EZRRoundState::ROUND_START || g_MotherZombies.size() == 0) + { + ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "There are no motherzombies."); + return; + } + + bool first = true; + std::string names = ""; + for (int i = g_MotherZombies.size() - 1; i >= 0; i--) + { + if (!g_MotherZombies[i].IsValid()) + { + g_MotherZombies.erase(g_MotherZombies.begin() + i); + continue; + } + + CCSPlayerController* pMZ = CCSPlayerController::FromSlot(g_MotherZombies[i].GetPlayerSlot()); + if (!pMZ) + continue; + + if (first) + { + names = pMZ->GetPlayerName(); + first = false; + } + else + { + names += ", " + pMZ->GetPlayerName(); + } + } + + if (first) + ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "There are no motherzombies."); + else + ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "Motherzombies: %s", names.c_str()); } \ No newline at end of file From dbec0d86bbb427547db456679fa75c7073916555 Mon Sep 17 00:00:00 2001 From: Vauff Date: Mon, 1 Jun 2026 11:56:52 -0400 Subject: [PATCH 2/2] grammar tweak --- src/zombiereborn.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/zombiereborn.cpp b/src/zombiereborn.cpp index 48be3cfb..885b7e81 100644 --- a/src/zombiereborn.cpp +++ b/src/zombiereborn.cpp @@ -2080,11 +2080,11 @@ CON_COMMAND_CHAT_FLAGS(revive, "- Revive a player", ADMFLAG_GENERIC) PrintMultiAdminAction(nType, strCommandPlayerName, "revived", "", ZR_PREFIX); } -CON_COMMAND_CHAT(motherzombies, "- Print the current motherzombies to chat") +CON_COMMAND_CHAT(motherzombies, "- Print the current mother zombies to chat") { if (g_ZRRoundState == EZRRoundState::ROUND_START || g_MotherZombies.size() == 0) { - ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "There are no motherzombies."); + ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "There are no mother zombies."); return; } @@ -2114,7 +2114,7 @@ CON_COMMAND_CHAT(motherzombies, "- Print the current motherzombies to chat") } if (first) - ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "There are no motherzombies."); + ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "There are no mother zombies."); else - ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "Motherzombies: %s", names.c_str()); + ClientPrint(player, HUD_PRINTTALK, ZR_PREFIX "Mother zombies: %s", names.c_str()); } \ No newline at end of file