@@ -56,6 +56,7 @@ static bool g_bRespawnEnabled = true;
5656static CHandle<CBaseEntity> g_hRespawnToggler;
5757static CHandle<CTeam> g_hTeamCT;
5858static CHandle<CTeam> g_hTeamT;
59+ std::vector<ZEPlayerHandle> g_MotherZombies;
5960
6061CZRPlayerClassManager* g_pZRPlayerClassManager = nullptr ;
6162ZRWeaponConfig* g_pZRWeaponConfig = nullptr ;
@@ -911,6 +912,8 @@ void ZR_OnRoundPrestart(IGameEvent* pEvent)
911912 if (pPawn)
912913 pPawn->m_bTakesDamage = false ;
913914 }
915+
916+ g_MotherZombies.clear ();
914917}
915918
916919void SetupRespawnToggler ()
@@ -1258,6 +1261,8 @@ void ZR_InfectMotherZombie(CCSPlayerController* pVictimController, std::vector<S
12581261
12591262 ZEPlayerHandle hPlayer = pZEPlayer->GetHandle ();
12601263 CTimer::Create (rand () % (int )g_cvarMoanInterval.Get (), TIMERFLAG_MAP | TIMERFLAG_ROUND , [hPlayer]() { return ZR_MoanTimer (hPlayer); });
1264+
1265+ g_MotherZombies.push_back (hPlayer);
12611266}
12621267
12631268// make players who've been picked as MZ recently less likely to be picked again
@@ -2090,4 +2095,43 @@ CON_COMMAND_CHAT_FLAGS(revive, "- Revive a player", ADMFLAG_GENERIC)
20902095 }
20912096 if (iNumClients > 1 )
20922097 PrintMultiAdminAction (nType, strCommandPlayerName, " revived" , " " , ZR_PREFIX );
2098+ }
2099+
2100+ CON_COMMAND_CHAT (motherzombies, " - Print the current mother zombies to chat" )
2101+ {
2102+ if (g_ZRRoundState == EZRRoundState::ROUND_START || g_MotherZombies.size () == 0 )
2103+ {
2104+ ClientPrint (player, HUD_PRINTTALK , ZR_PREFIX " There are no mother zombies." );
2105+ return ;
2106+ }
2107+
2108+ bool first = true ;
2109+ std::string names = " " ;
2110+ for (int i = g_MotherZombies.size () - 1 ; i >= 0 ; i--)
2111+ {
2112+ if (!g_MotherZombies[i].IsValid ())
2113+ {
2114+ g_MotherZombies.erase (g_MotherZombies.begin () + i);
2115+ continue ;
2116+ }
2117+
2118+ CCSPlayerController* pMZ = CCSPlayerController::FromSlot (g_MotherZombies[i].GetPlayerSlot ());
2119+ if (!pMZ)
2120+ continue ;
2121+
2122+ if (first)
2123+ {
2124+ names = pMZ->GetPlayerName ();
2125+ first = false ;
2126+ }
2127+ else
2128+ {
2129+ names += " , " + pMZ->GetPlayerName ();
2130+ }
2131+ }
2132+
2133+ if (first)
2134+ ClientPrint (player, HUD_PRINTTALK , ZR_PREFIX " There are no mother zombies." );
2135+ else
2136+ ClientPrint (player, HUD_PRINTTALK , ZR_PREFIX " Mother zombies: %s" , names.c_str ());
20932137}
0 commit comments