updated knockback low pop modifier
This commit is contained in:
parent
9606606baf
commit
b57f8fdd68
@ -1,55 +1,65 @@
|
|||||||
#include <sourcemod>
|
#include <sourcemod>
|
||||||
#include <BotTargeting>
|
#include <BotTargeting>
|
||||||
#include <cstrike>
|
#include <cstrike>
|
||||||
|
|
||||||
public Plugin myinfo =
|
public Plugin myinfo =
|
||||||
{
|
{
|
||||||
name = "knockback low pop modifier",
|
name = "knockback low pop modifier",
|
||||||
author = "jenz",
|
author = "jenz",
|
||||||
description = "balances knockback for low population",
|
description = "balances knockback for low population",
|
||||||
version = "1.0.0",
|
version = "1.0.0",
|
||||||
url = ""
|
url = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPluginStart()
|
public void OnPluginStart()
|
||||||
{
|
{
|
||||||
HookEvent("round_end", OnRoundEnd);
|
HookEvent("round_start", OnRoundStart);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPluginEnd()
|
public void OnPluginEnd()
|
||||||
{
|
{
|
||||||
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnMapEnd()
|
public void OnMapEnd()
|
||||||
{
|
{
|
||||||
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnRoundEnd(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
public void OnRoundStart(Event hEvent, const char[] sEvent, bool bDontBroadcast)
|
||||||
{
|
{
|
||||||
int active_player_count = 0;
|
int active_player_count = 0;
|
||||||
for (int i = 1; i <= MaxClients; i++)
|
|
||||||
{
|
for (int i = 1; i <= MaxClients; i++)
|
||||||
if(IsClientConnected(i) && IsClientInGame(i) && IsClientAuthorized(i) && !IsFakeClient(i) && !IsClientAutismBot(i) && !IsClientSourceTV(i) && GetClientTeam(i) != CS_TEAM_SPECTATOR)
|
{
|
||||||
{
|
if(IsClientConnected(i) && IsClientInGame(i) && IsClientAuthorized(i) && !IsFakeClient(i) && !IsClientAutismBot(i) && !IsClientSourceTV(i) && GetClientTeam(i) > CS_TEAM_SPECTATOR)
|
||||||
active_player_count++;
|
{
|
||||||
}
|
active_player_count++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
int zombie_ratio = GetConVarInt(FindConVar("zr_infect_mzombie_ratio")) * 2;
|
|
||||||
if (active_player_count < zombie_ratio)
|
if (active_player_count < 24)
|
||||||
{
|
{
|
||||||
float knockback_increase = float(zombie_ratio) / float(active_player_count);
|
int zombie_ratio = GetConVarInt(FindConVar("zr_infect_mzombie_ratio"));
|
||||||
//random capacity of 3
|
|
||||||
if (knockback_increase > 3.0)
|
float knockback_increase = float(zombie_ratio) / float(active_player_count);
|
||||||
{
|
|
||||||
knockback_increase = 3.0;
|
if (knockback_increase > 3.0)
|
||||||
}
|
knockback_increase = 3.0;
|
||||||
|
else if(knockback_increase < 1.0)
|
||||||
PrintToChatAll("LOW POP: increased zombie knockback to X%f to balance gameplay", knockback_increase);
|
knockback_increase = 1.0
|
||||||
PrintToChatAll("LOW POP: increased zombie knockback to X%f to balance gameplay", knockback_increase);
|
|
||||||
PrintToChatAll("LOW POP: increased zombie knockback to X%f to balance gameplay", knockback_increase);
|
if (knockback_increase > 1.0)
|
||||||
ServerCommand("zr_class_set_multiplier zombies knockback %f", 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);
|
||||||
|
PrintToChatAll("LOW POP: increased zombie knockback to X%.2f to balance gameplay", knockback_increase);
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerCommand("zr_class_set_multiplier zombies knockback %.2f", knockback_increase);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ServerCommand("zr_class_set_multiplier zombies knockback 1.0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user