forked from UNLOZE/sm-plugins
added natives in mapchooser for knockback low pop plugin which now on low pop gives infintie ammo and high HP for doing difficult maps
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#include <sourcemod>
|
||||
#include <BotTargeting>
|
||||
#include <cstrike>
|
||||
#include <mapchooser_extended>
|
||||
|
||||
bool g_bDoingMapTouristMode;
|
||||
|
||||
public Plugin myinfo =
|
||||
{
|
||||
@@ -14,18 +17,39 @@ public Plugin myinfo =
|
||||
public void OnPluginStart()
|
||||
{
|
||||
HookEvent("round_start", OnRoundStart);
|
||||
g_bDoingMapTouristMode = false;
|
||||
}
|
||||
|
||||
public void OnPluginEnd()
|
||||
{
|
||||
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
||||
g_bDoingMapTouristMode = false;
|
||||
}
|
||||
|
||||
public void OnMapEnd()
|
||||
{
|
||||
g_bDoingMapTouristMode = false;
|
||||
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
||||
}
|
||||
|
||||
public void OnMapStart()
|
||||
{
|
||||
char map[PLATFORM_MAX_PATH];
|
||||
GetCurrentMap(map, PLATFORM_MAX_PATH);
|
||||
|
||||
//skipping de_, cs_, zm_ maps
|
||||
if (StrContains(map, "ze_") == 0)
|
||||
{
|
||||
//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
|
||||
|| GetMapMinHoursAvg(map) != 0)
|
||||
{
|
||||
g_bDoingMapTouristMode = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||
{
|
||||
int active_player_count = 0;
|
||||
@@ -51,15 +75,36 @@ public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||
|
||||
if (knockback_increase > 1.0)
|
||||
{
|
||||
PrintToChatAll("LOW POP: increased zombie knockback to X%.2f to balance gameplay", knockback_increase);
|
||||
PrintToChatAll("LOW POP: increased zombie knockback to X%.2f to balance gameplay", knockback_increase);
|
||||
PrintToChatAll("LOW POP: increased zombie knockback to X%.2f to balance gameplay", knockback_increase);
|
||||
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
|
||||
{
|
||||
PrintToChatAll("LOW POP: increased zombie knockback to X%.2f to balance gameplay", knockback_increase);
|
||||
PrintToChatAll("LOW POP: increased zombie knockback to X%.2f to balance gameplay", knockback_increase);
|
||||
PrintToChatAll("LOW POP: increased zombie knockback to X%.2f to balance gameplay", knockback_increase);
|
||||
}
|
||||
}
|
||||
|
||||
ServerCommand("zr_class_set_multiplier zombies knockback %.2f", knockback_increase);
|
||||
if (!g_bDoingMapTouristMode)
|
||||
{
|
||||
ServerCommand("zr_class_set_multiplier zombies knockback %.2f", knockback_increase);
|
||||
}
|
||||
ServerCommand("sm_iammo @all 0");
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
||||
ServerCommand("sm_iammo @all 0");
|
||||
}
|
||||
}
|
||||
|
||||
public Action SetHealthOnCT(Handle timer)
|
||||
{
|
||||
ServerCommand("sm_iammo @all 1");
|
||||
ServerCommand("sm_hp @ct 500");
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user