added low player count feature that gives extra hp and infinite ammo on difficult maps with low population

This commit is contained in:
jenz 2026-04-14 15:17:19 +02:00
parent b4c4b11c3d
commit 208d084024

View File

@ -42,7 +42,7 @@ public void OnMapStart()
{
//Decided for now to exclude MaxPlayers
//MaxTime, MinTime, MinPlayers, CooldownTime, MinHoursAvg
if (GetMapMaxTime(map) != 0 || GetMapMinTime(map) != 0 || GetMapMinPlayers(map) != 0 /*|| GetMapMaxPlayers(map) != 0*/ || GetMapCooldownTime(map) != 0
if (GetMapMaxTime(map) != 0 || GetMapMinTime(map) != 0 || GetMapMinPlayers(map) != 0 /*|| GetMapMaxPlayers(map) != 0*/ || GetMapCooldownTime(map) > 60
|| GetMapMinHoursAvg(map) != 0)
{
g_bDoingMapTouristMode = true;
@ -73,13 +73,10 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
else if(knockback_increase < 1.0)
knockback_increase = 1.0
if (knockback_increase > 1.0)
if (knockback_increase > 1.0 || (g_bDoingMapTouristMode && active_player_count < 18))
{
if (g_bDoingMapTouristMode)
{
PrintToChatAll("LOW POP ON DIFFICULT MAP: ENABLING INFINITE AMMO AND 500 HP FOR CT");
PrintToChatAll("LOW POP ON DIFFICULT MAP: ENABLING INFINITE AMMO AND 500 HP FOR CT");
PrintToChatAll("LOW POP ON DIFFICULT MAP: ENABLING INFINITE AMMO AND 500 HP FOR CT");
CreateTimer(3.0, SetHealthOnCT);
}
else
@ -104,6 +101,9 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
public Action SetHealthOnCT(Handle timer)
{
PrintToChatAll("LOW POP ON DIFFICULT MAP: ENABLING INFINITE AMMO AND 500 HP FOR CT");
PrintToChatAll("LOW POP ON DIFFICULT MAP: ENABLING INFINITE AMMO AND 500 HP FOR CT");
PrintToChatAll("LOW POP ON DIFFICULT MAP: ENABLING INFINITE AMMO AND 500 HP FOR CT");
ServerCommand("sm_iammo @all 1");
ServerCommand("sm_hp @ct 500");
return Plugin_Handled;