instead of checking player count on each round start its checked globally every 2 minutes so that the first round on new maps dont give the extra help just because of players joining late
This commit is contained in:
parent
2b67f52368
commit
8e46053c0b
@ -3,6 +3,7 @@
|
||||
#include <mapchooser_extended>
|
||||
|
||||
int g_iDoingMapTouristMode;
|
||||
int g_iActivePlayerCount;
|
||||
|
||||
public Plugin myinfo =
|
||||
{
|
||||
@ -16,13 +17,34 @@ public Plugin myinfo =
|
||||
public void OnPluginStart()
|
||||
{
|
||||
HookEvent("round_start", OnRoundStart);
|
||||
CreateTimer(120.0, CheckPopulation, _, TIMER_REPEAT);
|
||||
g_iDoingMapTouristMode = 0;
|
||||
g_iActivePlayerCount = 0;
|
||||
}
|
||||
|
||||
public Action CheckPopulation(Handle timer)
|
||||
{
|
||||
int TimeLeft;
|
||||
if (GetMapTimeLeft(TimeLeft) && TimeLeft < 0)
|
||||
{
|
||||
return Plugin_Continue;
|
||||
}
|
||||
g_iActivePlayerCount = 0;
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if (IsClientConnected(i) && IsClientInGame(i) && IsClientAuthorized(i))
|
||||
{
|
||||
g_iActivePlayerCount++;
|
||||
}
|
||||
}
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public void OnPluginEnd()
|
||||
{
|
||||
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
||||
g_iDoingMapTouristMode = 0;
|
||||
g_iActivePlayerCount = 0;
|
||||
}
|
||||
|
||||
public void OnMapEnd()
|
||||
@ -49,27 +71,12 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
||||
ServerCommand("sm_iammo @all 0");
|
||||
|
||||
int TimeLeft;
|
||||
if (GetMapTimeLeft(TimeLeft) && TimeLeft < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int active_player_count = 0;
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
if (IsClientConnected(i) && IsClientInGame(i) && IsClientAuthorized(i))
|
||||
{
|
||||
active_player_count++;
|
||||
}
|
||||
}
|
||||
|
||||
int choosen_number = 28;
|
||||
if (g_iDoingMapTouristMode > active_player_count > 0)
|
||||
if (g_iDoingMapTouristMode > g_iActivePlayerCount > 0)
|
||||
{
|
||||
CreateTimer(3.0, SetHealthOnCT);
|
||||
}
|
||||
else if (active_player_count < choosen_number)
|
||||
else if (g_iActivePlayerCount < choosen_number)
|
||||
{
|
||||
int zombie_ratio = GetConVarInt(FindConVar("zr_infect_mzombie_ratio"));
|
||||
int infectectable_players = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user