Add ChatFilter2, OverheadChat, EventGreeting and update several plugins

New plugins: ChatFilter2, OverheadChat, EventGreeting.

Updated: HostnameManager, Leader3 (chat and markers), NameFilter2 (plugin
and config), PlayerRankings_nohlstats (rank display modes), custom-chatcolors
(plugin and ccc.inc), Extend (sm_settimeleft).

Add shared includes the plugins build against: Break, ChatFilter2, Couch,
EventNotifier, TransmitManager, leader, ripext, unloze_playtime.
This commit is contained in:
2026-11-23 13:20:15 +00:00
parent 2dca39be8a
commit 3a52b1dfd1
25 changed files with 6209 additions and 175 deletions
+40 -3
View File
@@ -15,6 +15,7 @@
#undef REQUIRE_PLUGIN
#include <AFKManager>
#include <ChatFilter2>
#define REQUIRE_PLUGIN
#pragma newdecls required
@@ -98,7 +99,15 @@ bool g_bLeaderWhitelisted[MAXPLAYERS + 1];
bool g_bForceLeaderMute;
bool g_bForceMuted[MAXPLAYERS + 1];
// Our own copy of ZR's zombie flag. ZR_IsClientZombie throws on dead clients and team is
// unreliable at death (ZR round-end balancing puts living zombies on CT), so player_death
// reads this instead. Set on infection, cleared on spawn/cure/disconnect like ZR's own flag.
bool g_bZombie[MAXPLAYERS + 1];
bool g_bAFKManager;
bool g_bChatFilter2;
// ChatFilter2 safe chat per client, kept by ChatFilter2_OnSafeChatChanged so transmit hooks need no native call
bool g_bSafeChat[MAXPLAYERS + 1];
bool g_bWorldTextBroken;
GlobalForward g_fwdOnLeaderAdded;
@@ -227,6 +236,13 @@ public void OnPluginStart()
AddMultiTargetFilter("@!leaders", Filter_NotLeaders, "everyone but the Leaders", false);
AddMultiTargetFilter("@leader", Filter_Leader, "the Primary Leader", false);
AddMultiTargetFilter("@!leader", Filter_NotLeader, "everyone but the Primary Leader", false);
// Late load: pick up zombies infected before we were running.
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
g_bZombie[i] = IsLivingZombie(i);
}
}
public void OnPluginEnd()
@@ -240,18 +256,24 @@ public void OnPluginEnd()
public void OnAllPluginsLoaded()
{
g_bAFKManager = LibraryExists("AFKManager");
if (LibraryExists("ChatFilter2"))
Chat_OnChatFilter2Added();
}
public void OnLibraryAdded(const char[] name)
{
if (StrEqual(name, "AFKManager"))
g_bAFKManager = true;
else if (StrEqual(name, "ChatFilter2"))
Chat_OnChatFilter2Added();
}
public void OnLibraryRemoved(const char[] name)
{
if (StrEqual(name, "AFKManager"))
g_bAFKManager = false;
else if (StrEqual(name, "ChatFilter2"))
Chat_OnChatFilter2Removed();
}
public void OnMapStart()
@@ -357,6 +379,9 @@ public void OnClientDisconnect(int client)
BaseComm_SetClientMute(client, false);
g_bForceMuted[client] = false;
}
g_bZombie[client] = false;
g_bSafeChat[client] = false;
}
public void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
@@ -368,6 +393,12 @@ public void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
public void Event_PlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
int userid = event.GetInt("userid");
// Everyone spawns human (ZR clears its flag here too); infection after spawn sets it again.
int client = GetClientOfUserId(userid);
if (client > 0)
g_bZombie[client] = false;
// Attach effects slightly late: at spawn time ZR state and position may not be final.
CreateTimer(0.3, Timer_ResumeEffects, userid, TIMER_FLAG_NO_MAPCHANGE);
}
@@ -386,9 +417,11 @@ public void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast
if (client <= 0)
return;
// Toll and announce only for an active (human) leader falling; an infected leader dying later as a zombie stays quiet.
// ZR_IsClientHuman throws on dead clients, so go by team: zombified leaders sit on T.
bool diedAsHuman = GetClientTeam(client) == CS_TEAM_CT;
// Toll and announce only for an active (human) leader falling. A leader who was infected,
// or picked as mother zombie, and then dies as a zombie stays quiet. ZR's fake infection
// death fires before ZR_OnClientInfected, so g_bZombie is still false for that one and the
// toll marks the infection.
bool diedAsHuman = !g_bZombie[client];
if (IsLeader(client) && diedAsHuman)
{
@@ -421,6 +454,8 @@ public void Event_PlayerTeam(Event event, const char[] name, bool dontBroadcast)
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
{
g_bZombie[client] = true;
char verb[80];
if (attacker > 0 && attacker <= MaxClients && attacker != client)
Format(verb, sizeof(verb), "has been infected by \x04%N\x01", attacker);
@@ -432,6 +467,8 @@ public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, boo
public void ZR_OnClientHumanPost(int client, bool respawn, bool protect)
{
g_bZombie[client] = false;
if (IsEffectsActive(client))
Effects_Resume(client);
}