Skip to content

Commit

Permalink
Syntax updates and minor fixes. (#395)
Browse files Browse the repository at this point in the history
* Update 'rock_stumble_block'.

1) Update syntax.
2) Removed unnecessary checks.

* Small update 'l4d_bash_kills'.

1) Fixed variable names.

* Update 'si_fire_immunity'.

1) Added 'trigger_hurt' to prevent first damage.

* Update syntax.

Update syntax.

* Cleanup

Cleanup

* Update l4d2_ladderblock.sp

* Fixed incorrect timer parameters.

Fixed incorrect timer parameters.
  • Loading branch information
A1mDev authored Oct 30, 2021
1 parent 3b49522 commit c0e5ae9
Show file tree
Hide file tree
Showing 41 changed files with 321 additions and 283 deletions.
Binary file modified addons/sourcemod/plugins/optional/bossspawningfix.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/finale_tank_blocker.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/finalefix.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/ghost_hurt.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/l4d2_fix_deathspit.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/l4d_bash_kills.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/rock_stumble_block.smx
Binary file not shown.
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/1v1.sp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void Event_PlayerHurt(Event hEvent, const char[] sEventName, bool bDontBr

int iRemainingHealth = GetClientHealth(iAttacker);

// [1v1] A1m` (Hunter) had 250 health remaining!
// [1v1] Player (Hunter) had 250 health remaining!
// [1v1] AI (Hunter) had 250 health remaining!

char sName[MAX_NAME_LENGTH];
Expand Down
63 changes: 30 additions & 33 deletions addons/sourcemod/scripting/bossspawningfix.sp
Original file line number Diff line number Diff line change
@@ -1,64 +1,61 @@
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <left4dhooks>

public Plugin:myinfo =
ConVar
g_hCvarEnabled = null,
g_hCvarSkipStaticMaps = null;

public Plugin myinfo =
{
name = "Versus Boss Spawn Persuasion",
author = "ProdigySim",
description = "Makes Versus Boss Spawns obey cvars",
version = "1.2",
url = "http://compl4d2.com/"
}

new Handle:hCvarEnabled;
new Handle:hCvarSkipStaticMaps;
version = "1.3",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};


public OnPluginStart()
public void OnPluginStart()
{
hCvarEnabled = CreateConVar("l4d_obey_boss_spawn_cvars", "1", "Enable forcing boss spawns to obey boss spawn cvars");
hCvarSkipStaticMaps = CreateConVar("l4d_obey_boss_spawn_except_static", "1", "Don't override boss spawning rules on Static Tank Spawn maps (c7m1, c13m2)");
g_hCvarEnabled = CreateConVar("l4d_obey_boss_spawn_cvars", "1", "Enable forcing boss spawns to obey boss spawn cvars", _, true, 0.0, true, 1.0);
g_hCvarSkipStaticMaps = CreateConVar("l4d_obey_boss_spawn_except_static", "1", "Don't override boss spawning rules on Static Tank Spawn maps (c7m1, c13m2)", _, true, 0.0, true, 1.0);
}


public Action:L4D_OnGetScriptValueInt(const String:key[], &retVal)
public Action L4D_OnGetScriptValueInt(const char[] sKey, int &retVal)
{
if(GetConVarBool(hCvarEnabled))
{
if(StrEqual(key, "DisallowThreatType"))
{
if (g_hCvarEnabled.BoolValue) {
if (strcmp(sKey, "DisallowThreatType") == 0) {
// Stop allowing threat types!
retVal = 0;
return Plugin_Handled;
}

if(StrEqual(key, "ProhibitBosses"))
{
// Fuck that!

if (strcmp(sKey, "ProhibitBosses") == 0) {
retVal = 0;
return Plugin_Handled;
return Plugin_Handled;
}
}
return Plugin_Continue;


return Plugin_Continue;
}

public Action:L4D_OnGetMissionVSBossSpawning(&Float:spawn_pos_min, &Float:spawn_pos_max, &Float:tank_chance, &Float:witch_chance)
public Action L4D_OnGetMissionVSBossSpawning(float &spawn_pos_min, float &spawn_pos_max, float &tank_chance, float &witch_chance)
{
if(GetConVarBool(hCvarEnabled))
{
if(GetConVarBool(hCvarSkipStaticMaps))
{
decl String:mapbuf[32];
GetCurrentMap(mapbuf, sizeof(mapbuf));
if(StrEqual(mapbuf, "c7m1_docks") || StrEqual(mapbuf, "c13m2_southpinestream"))
{
if (g_hCvarEnabled.BoolValue) {
if (g_hCvarSkipStaticMaps.BoolValue) {
char sMapName[32];
GetCurrentMap(sMapName, sizeof(sMapName));

if (strcmp(sMapName, "c7m1_docks") == 0 || strcmp(sMapName, "c13m2_southpinestream") == 0) {
return Plugin_Continue;
}
}

return Plugin_Handled;
}

return Plugin_Continue;
}
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/code_patcher.sp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ArrayList
public Plugin myinfo =
{
name = "Code patcher",
author = "Jahze?", //new syntax A1m`, fix unload error
author = "Jahze?, A1m`",
version = "1.1",
description = "Code patcher",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/current.sp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ConVar g_hVsBossBuffer;
public Plugin myinfo =
{
name = "L4D2 Survivor Progress",
author = "CanadaRox, Visor", //update syntax A1m`
author = "CanadaRox, Visor",
description = "Print survivor progress in flow percents ",
version = "2.0.2",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
Expand Down
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/eq_finale_tanks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int
public Plugin myinfo =
{
name = "EQ2 Finale Tank Manager",
author = "Visor, Electr0", //Update syntax A1m`
author = "Visor, Electr0",
description = "Either two event tanks or one flow and one (second) event tank",
version = "2.5.2",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
Expand Down
65 changes: 40 additions & 25 deletions addons/sourcemod/scripting/finale_tank_blocker.sp
Original file line number Diff line number Diff line change
@@ -1,55 +1,70 @@
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <left4dhooks>

#define FINALE_STAGE_TANK 8

new Handle:hFinaleExceptionMaps;
StringMap
g_hFinaleExceptionMaps = null;

new iTankCount[2];
int
g_iTankCount[2] = {0, 0};

public Plugin:myinfo =
public Plugin myinfo =
{
name = "Finale Even-Numbered Tank Blocker",
author = "Stabby, Visor",
description = "Blocks even-numbered non-flow finale tanks.",
version = "2",
url = "http://github.com/ConfoglTeam/ProMod"
version = "2.1",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};

public OnPluginStart()
public void OnPluginStart()
{
RegServerCmd("finale_tank_default", SetFinaleExceptionMap);

hFinaleExceptionMaps = CreateTrie();
g_hFinaleExceptionMaps = new StringMap();
}

public Action:SetFinaleExceptionMap(args)
public void OnMapEnd()
{
decl String:mapname[64];
GetCmdArg(1, mapname, sizeof(mapname));
SetTrieValue(hFinaleExceptionMaps, mapname, true);
g_iTankCount[0] = 0;
g_iTankCount[1] = 0;
}

public Action SetFinaleExceptionMap(int iArgs)
{
if (iArgs != 1) {
PrintToServer("Usage: finale_tank_default <mapname>");
LogError("Usage: finale_tank_default <mapname>");
return Plugin_Handled;
}

char sMapName[64];
GetCmdArg(1, sMapName, sizeof(sMapName));
g_hFinaleExceptionMaps.SetValue(sMapName, true);

return Plugin_Handled;
}

public Action:L4D2_OnChangeFinaleStage(&finaleType, const String:arg[])
public Action L4D2_OnChangeFinaleStage(int &iFinaleType, const char[] sArg)
{
decl String:mapname[64];
GetCurrentMap(mapname, sizeof(mapname));
char sMapName[64];
GetCurrentMap(sMapName, sizeof(sMapName));

decl dummy;
if (GetTrieValue(hFinaleExceptionMaps, mapname, dummy))
int iValue = 0;
if (g_hFinaleExceptionMaps.GetValue(sMapName, iValue)) {
return Plugin_Continue;
}

if (finaleType == FINALE_STAGE_TANK)
{
if (++iTankCount[GameRules_GetProp("m_bInSecondHalfOfRound")] % 2 == 0)
if (iFinaleType == FINALE_STAGE_TANK) {
if (++g_iTankCount[GameRules_GetProp("m_bInSecondHalfOfRound")] % 2 == 0) {
return Plugin_Handled;
}
}

return Plugin_Continue;
}

public OnMapEnd()
{
iTankCount[0] = 0;
iTankCount[1] = 0;
}
26 changes: 16 additions & 10 deletions addons/sourcemod/scripting/finalefix.sp
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>

public Plugin:myinfo =
#define TEAM_SURVIVOR 2

public Plugin myinfo =
{
name = "L4D2 Finale Incap Distance Fixifier",
author = "CanadaRox",
description = "Kills survivors before the score is calculated so you don't get full distance if you are incapped as the rescue vehicle leaves.",
version = "1.0.1",
url = "https://bitbucket.org/CanadaRox/random-sourcemod-stuff"
version = "1.0.2",
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
};

public OnPluginStart()
public void OnPluginStart()
{
HookEvent("finale_vehicle_leaving", FinaleEnd_Event, EventHookMode_PostNoCopy);
}

public FinaleEnd_Event(Handle:event, const String:name[], bool:dontBroadcast)
public void FinaleEnd_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast)
{
for (new i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerIncap(i))
{
for (int i = 1; i <= MaxClients; i++) {
if (IsClientInGame(i) && GetClientTeam(i) == TEAM_SURVIVOR && IsPlayerIncap(i)) {
ForcePlayerSuicide(i);
}
}
}

stock IsPlayerIncap(client) return GetEntProp(client, Prop_Send, "m_isIncapacitated");
bool IsPlayerIncap(int iClient)
{
return view_as<bool>(GetEntProp(iClient, Prop_Send, "m_isIncapacitated", 1));
}
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/fix_engine.sp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public Plugin:myinfo =
{
name = "[L4D & L4D2] Engine Fix",
author = "raziEiL [disawar1]", //Add support sm 1.11 - A1m`
author = "raziEiL [disawar1]",
description = "Blocking ladder speed glitch, no fall damage bug, health boost glitch.",
version = PLUGIN_VERSION,
url = "https://github.com/SirPlease/L4D2-Competitive-Rework"
Expand Down
Loading

0 comments on commit c0e5ae9

Please sign in to comment.