Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
39 changes: 39 additions & 0 deletions addons/sourcemod/scripting/l4d2_spitter_acid_blocker.sp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <left4dhooks>

#define L4D2_TEAM_INFECTED 3

public Plugin myinfo =
{
name = "L4D2 - Spitter Acid Blocker",
author = "Altair Sossai",
description = "Prevents Spitter acid damage if the player controlling the Spitter enters spectator mode or switches teams before dying",
version = "1.0.0",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};

public void OnPluginStart()
{
HookEvent("player_team", PlayerTeam_Event, EventHookMode_Post);
}

void PlayerTeam_Event(Event event, const char[] name, bool dontBroadcast)
{
int oldTeam = GetEventInt(event, "oldteam");
if (oldTeam != L4D2_TEAM_INFECTED)
return;

int client = GetClientOfUserId(GetEventInt(event, "userid"));
int entity = -1;

while((entity = FindEntityByClassname(entity, "insect_swarm")) != INVALID_ENT_REFERENCE)
{
if(GetEntPropEnt(entity, Prop_Data, "m_hOwnerEntity") != client)
continue;

AcceptEntityInput(entity, "Kill");
}
}
1 change: 1 addition & 0 deletions cfg/generalfixes.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ sm plugins load fixes/l4d_fix_rotated_physblocker.smx
sm plugins load fixes/firebulletsfix.smx
sm plugins load fixes/l4d_fix_stagger_dir.smx
sm plugins load fixes/l4d2_fix_rocket_pull.smx
sm plugins load fixes/l4d2_spitter_acid_blocker.smx

// Anti-Cheat.
sm plugins load anticheat/l4d2_noghostcheat.smx