just adding a boolean check on mapend to skip updating playercount first time the timer triggers

This commit is contained in:
jenz 2026-04-21 21:35:14 +02:00
parent 8e46053c0b
commit 45258da9e1

View File

@ -4,6 +4,7 @@
int g_iDoingMapTouristMode;
int g_iActivePlayerCount;
bool g_bMapended;
public Plugin myinfo =
{
@ -17,9 +18,10 @@ public Plugin myinfo =
public void OnPluginStart()
{
HookEvent("round_start", OnRoundStart);
CreateTimer(120.0, CheckPopulation, _, TIMER_REPEAT);
CreateTimer(80.0, CheckPopulation, _, TIMER_REPEAT);
g_iDoingMapTouristMode = 0;
g_iActivePlayerCount = 0;
g_bMapended = false;
}
public Action CheckPopulation(Handle timer)
@ -29,6 +31,12 @@ public Action CheckPopulation(Handle timer)
{
return Plugin_Continue;
}
if (g_bMapended)
{
g_bMapended = false;
return Plugin_Continue;
}
g_iActivePlayerCount = 0;
for (int i = 1; i <= MaxClients; i++)
{
@ -51,6 +59,7 @@ public void OnMapEnd()
{
g_iDoingMapTouristMode = 0;
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
g_bMapended = true;
}
public void OnMapStart()