From 88241a85b96b9f553c0dc5f09efa1995a1103d61 Mon Sep 17 00:00:00 2001 From: A1m` <33463136+A1mDev@users.noreply.github.com> Date: Mon, 12 Feb 2024 04:31:06 +0700 Subject: [PATCH] Fixed several warnings in sm 1.12 (#735) --- .../scripting/l4d2_blind_infected.sp | 3 +- .../sourcemod/scripting/l4d2_ladder_rambos.sp | 4 +- .../sourcemod/scripting/l4d2_magnum_incap.sp | 3 +- .../sourcemod/scripting/l4d2_nosey_parker.sp | 10 ++-- addons/sourcemod/scripting/l4d2_pickup.sp | 5 +- addons/sourcemod/scripting/l4d2_riotcops.sp | 3 +- addons/sourcemod/scripting/l4d2_scoremod.sp | 56 ++++++++++++------- .../sourcemod/scripting/l4d2_skill_detect.sp | 8 +-- addons/sourcemod/scripting/l4d2_stats.sp | 22 +++----- .../scripting/l4d_fix_common_shove.sp | 4 +- .../scripting/l4d_fix_punch_block.sp | 4 +- .../sourcemod/scripting/left4dhooks_test.sp | 2 - addons/sourcemod/scripting/pill_passer.sp | 3 +- .../scripting/weapon_spawn_duplicate_fix.sp | 7 ++- 14 files changed, 65 insertions(+), 69 deletions(-) diff --git a/addons/sourcemod/scripting/l4d2_blind_infected.sp b/addons/sourcemod/scripting/l4d2_blind_infected.sp index 87c279499..b5a173624 100644 --- a/addons/sourcemod/scripting/l4d2_blind_infected.sp +++ b/addons/sourcemod/scripting/l4d2_blind_infected.sp @@ -9,7 +9,6 @@ #define ENT_CHECK_INTERVAL 1.0 #define TRACE_TOLERANCE 75.0 -#define ENTITY_MAX_NAME_LENGTH 64 enum { @@ -61,7 +60,7 @@ public Plugin myinfo = name = "Blind Infected", author = "CanadaRox, ProdigySim, A1m`", description = "Hides specified weapons from the infected team until they are (possibly) visible to one of the survivors to prevent SI scouting the map", - version = "1.2.1", + version = "1.2.2", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; diff --git a/addons/sourcemod/scripting/l4d2_ladder_rambos.sp b/addons/sourcemod/scripting/l4d2_ladder_rambos.sp index 469bc35c6..8d265ca9c 100644 --- a/addons/sourcemod/scripting/l4d2_ladder_rambos.sp +++ b/addons/sourcemod/scripting/l4d2_ladder_rambos.sp @@ -1,4 +1,4 @@ -#define PLUGIN_VERSION "4.2" +#define PLUGIN_VERSION "4.2.1" /* * Ladder Rambos Dhooks @@ -38,8 +38,6 @@ #include #include #include - -#define REQUIRE_EXTENSIONS #include #define GAMEDATA "l4d2_ladderrambos" diff --git a/addons/sourcemod/scripting/l4d2_magnum_incap.sp b/addons/sourcemod/scripting/l4d2_magnum_incap.sp index ee689eeb5..f7fa9e37b 100644 --- a/addons/sourcemod/scripting/l4d2_magnum_incap.sp +++ b/addons/sourcemod/scripting/l4d2_magnum_incap.sp @@ -6,7 +6,6 @@ #define L4D2UTIL_STOCKS_ONLY 1 #include -#define ENTITY_MAX_NAME_LENGTH 64 #define DEBUG 0 ConVar g_hReplaceMagnum = null; @@ -17,7 +16,7 @@ public Plugin myinfo = name = "Magnum incap remover", author = "robex, Sir", description = "Replace magnum with regular pistols when incapped.", - version = "0.4", + version = "0.4.1", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; diff --git a/addons/sourcemod/scripting/l4d2_nosey_parker.sp b/addons/sourcemod/scripting/l4d2_nosey_parker.sp index df94d492f..99275338e 100644 --- a/addons/sourcemod/scripting/l4d2_nosey_parker.sp +++ b/addons/sourcemod/scripting/l4d2_nosey_parker.sp @@ -27,8 +27,6 @@ #define L4D2UTIL_STOCKS_ONLY 1 #include -#define TEAM_SURVIVOR 2 -#define TEAM_INFECTED 3 #define ARRAY_INDEX_TIMESTAMP 0 //DT_IntervalTimer ConVar @@ -48,7 +46,7 @@ public Plugin myinfo = { name = "L4D2 Display Infected HP", author = "Visor, A1m`", - version = "1.5.2", + version = "1.5.3", description = "Survivors receive damage reports after they get capped", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; @@ -85,7 +83,7 @@ public void Event_PlayerHurt(Event hEvent, const char[] sEventName, bool bDontBr int iVictim = GetClientOfUserId(hEvent.GetInt("userid")); if (iVictim > 0 && IsClientInGame(iVictim) - && GetClientTeam(iVictim) == TEAM_INFECTED + && GetClientTeam(iVictim) == TEAM_ZOMBIE && IsTargetedSi(iVictim) > 0 ) { @@ -106,7 +104,7 @@ public void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontB int iClient = GetClientOfUserId(hEvent.GetInt("userid")); if (iClient == 0 || !IsClientInGame(iClient) - || GetClientTeam(iClient) != TEAM_INFECTED + || GetClientTeam(iClient) != TEAM_ZOMBIE ) { return; } @@ -130,7 +128,7 @@ public void Event_CHJ_Attack(Event hEvent, const char[] sEventName, bool bDontBr int iAttacker = GetClientOfUserId(hEvent.GetInt("userid")); if (iAttacker == 0 || !IsClientInGame(iAttacker) - || GetClientTeam(iAttacker) != TEAM_INFECTED + || GetClientTeam(iAttacker) != TEAM_ZOMBIE || !IsPlayerAlive(iAttacker) ) { return; diff --git a/addons/sourcemod/scripting/l4d2_pickup.sp b/addons/sourcemod/scripting/l4d2_pickup.sp index 0bedca680..4a72f5e82 100644 --- a/addons/sourcemod/scripting/l4d2_pickup.sp +++ b/addons/sourcemod/scripting/l4d2_pickup.sp @@ -42,9 +42,6 @@ #define FLAGS_INCAP_TANKPUNCH 2 #define FLAGS_INCAP_TANKROCK 4 -#define TEAM_SURVIVOR 2 -#define TEAM_INFECTED 3 - bool bLateLoad, bTanked[MAXPLAYERS + 1], @@ -72,7 +69,7 @@ public Plugin myinfo = name = "L4D2 Pick-up Changes", author = "Sir, A1m`", description = "Alters a few things regarding picking up/giving items and incapped Players.", - version = "1.2.2", + version = "1.2.3", url = "https://github.com/SirPlease/L4D2-Competitive-Rework/" } diff --git a/addons/sourcemod/scripting/l4d2_riotcops.sp b/addons/sourcemod/scripting/l4d2_riotcops.sp index bd17c22ab..eca984ba3 100644 --- a/addons/sourcemod/scripting/l4d2_riotcops.sp +++ b/addons/sourcemod/scripting/l4d2_riotcops.sp @@ -28,7 +28,6 @@ #include #define PARISH_PREFIX "c5m" -#define HITGROUP_HEAD 1 bool g_bPluginActive = false; @@ -37,7 +36,7 @@ public Plugin myinfo = { name = "L4D2 Riot Cops", author = "Jahze, Visor, A1m`", - version = "1.6", + version = "1.6.1", description = "Allow riot cops to be killed by a headshot" } diff --git a/addons/sourcemod/scripting/l4d2_scoremod.sp b/addons/sourcemod/scripting/l4d2_scoremod.sp index 09930dbc2..adb87b919 100644 --- a/addons/sourcemod/scripting/l4d2_scoremod.sp +++ b/addons/sourcemod/scripting/l4d2_scoremod.sp @@ -5,8 +5,8 @@ #include #undef REQUIRE_PLUGIN #include -#include #define REQUIRE_PLUGIN +#include #define DEBUG_SM 0 @@ -15,7 +15,7 @@ public Plugin myinfo = name = "L4D2 Scoremod", author = "CanadaRox, ProdigySim", description = "L4D2 Custom Scoring System (Health Bonus)", - version = "1.1.1", + version = "1.1.2", url = "https://bitbucket.org/CanadaRox/random-sourcemod-stuff" }; @@ -124,16 +124,14 @@ public OnPluginStart() SM_iAdrenPercent = GetConVarInt(SM_hAdrenPercent); RegConsoleCmd("sm_health", SM_Cmd_Health); -} - -public OnAllPluginsLoaded() -{ + l4d2lib_available = LibraryExists("l4d2lib"); + } public OnLibraryRemoved(const String:name[]) { - if (StrEqual(name, "l4d2lib")) + if (strcmp(name, "l4d2lib") == 0) { l4d2lib_available = false; } @@ -141,7 +139,7 @@ public OnLibraryRemoved(const String:name[]) public OnLibraryAdded(const String:name[]) { - if (StrEqual(name, "l4d2lib")) + if (strcmp(name, "l4d2lib") == 0) { l4d2lib_available = true; } @@ -184,20 +182,37 @@ public SM_ConVarChanged_Enable(Handle:convar, const String:oldValue[], const Str { PluginDisable(); SM_bModuleIsEnabled = false; + return; } - else - { - PluginEnable(); - SM_bModuleIsEnabled = true; - } + + PluginEnable(); + SM_bModuleIsEnabled = true; +} + +public SM_ConVarChanged_TempMulti0(Handle:convar, const String:oldValue[], const String:newValue[]) +{ + SM_fTempMulti[0] = StringToFloat(newValue); } -public SM_ConVarChanged_TempMulti0(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fTempMulti[0] = StringToFloat(newValue); -public SM_ConVarChanged_TempMulti1(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fTempMulti[1] = StringToFloat(newValue); -public SM_ConVarChanged_TempMulti2(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fTempMulti[2] = StringToFloat(newValue); +public SM_ConVarChanged_TempMulti1(Handle:convar, const String:oldValue[], const String:newValue[]) +{ + SM_fTempMulti[1] = StringToFloat(newValue); +} -public SM_CVChanged_HealthBonusRatio(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fHBRatio = StringToFloat(newValue); -public SM_CVChanged_SurvivalBonusRatio(Handle:convar, const String:oldValue[], const String:newValue[]) SM_fSurvivalBonusRatio = StringToFloat(newValue); +public SM_ConVarChanged_TempMulti2(Handle:convar, const String:oldValue[], const String:newValue[]) +{ + SM_fTempMulti[2] = StringToFloat(newValue); +} + +public SM_CVChanged_HealthBonusRatio(Handle:convar, const String:oldValue[], const String:newValue[]) +{ + SM_fHBRatio = StringToFloat(newValue); +} + +public SM_CVChanged_SurvivalBonusRatio(Handle:convar, const String:oldValue[], const String:newValue[]) +{ + SM_fSurvivalBonusRatio = StringToFloat(newValue); +} public SM_ConVarChanged_Health(Handle:convar, const String:oldValue[], const String:newValue[]) { @@ -303,7 +318,10 @@ public Action:SM_FinaleVehicleLeaving_Event(Handle:event, const String:name[], b SetConVarInt(SM_hSurvivalBonus, SM_CalculateSurvivalBonus()); } -SM_IsPlayerIncap(client) return GetEntProp(client, Prop_Send, "m_isIncapacitated"); +bool:SM_IsPlayerIncap(client) +{ + return (GetEntProp(client, Prop_Send, "m_isIncapacitated", 1) > 0); +} public Action:SM_Cmd_Health(client, args) { diff --git a/addons/sourcemod/scripting/l4d2_skill_detect.sp b/addons/sourcemod/scripting/l4d2_skill_detect.sp index cb78ada58..ff1daa896 100644 --- a/addons/sourcemod/scripting/l4d2_skill_detect.sp +++ b/addons/sourcemod/scripting/l4d2_skill_detect.sp @@ -61,7 +61,7 @@ #include #include -#define PLUGIN_VERSION "1.1" +#define PLUGIN_VERSION "1.1.1" #define SHOTGUN_BLAST_TIME 0.1 #define POUNCE_CHECK_TIME 0.1 @@ -95,12 +95,6 @@ #define ZC_TANK 8 #define HITGROUP_HEAD 1 -#define DMG_CRUSH (1 << 0) // crushed by falling or moving object. -#define DMG_BULLET (1 << 1) // shot -#define DMG_SLASH (1 << 2) // cut, clawed, stabbed -#define DMG_CLUB (1 << 7) // crowbar, punch, headbutt -#define DMG_BUCKSHOT (1 << 29) // not quite a bullet. Little, rounder, different. - #define DMGARRAYEXT 7 // MAXPLAYERS+# -- extra indices in witch_dmg_array + 1 #define CUT_SHOVED 1 // smoker got shoved diff --git a/addons/sourcemod/scripting/l4d2_stats.sp b/addons/sourcemod/scripting/l4d2_stats.sp index 546281951..2ff98ff4e 100644 --- a/addons/sourcemod/scripting/l4d2_stats.sp +++ b/addons/sourcemod/scripting/l4d2_stats.sp @@ -3,12 +3,8 @@ #include #define L4D2UTIL_STOCKS_ONLY 1 -#include #include - -#define TEAM_SPECTATOR 1 -#define TEAM_SURVIVOR 2 -#define TEAM_INFECTED 3 +#include #define BOOMER_STAGGER_TIME 4.0 // Amount of time after a boomer has been meleed that we consider the meleer the person who // shut down the boomer, this is just a guess value.. @@ -45,7 +41,7 @@ public Plugin myinfo = name = "L4D2 Realtime Stats", author = "Griffin, Philogl, Sir, A1m`", description = "Display Skeets/Etc to Chat to clients", - version = "1.2.2", + version = "1.2.3", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" } @@ -77,7 +73,7 @@ public void Event_PlayerSpawn(Event hEvent, const char[] sEventName, bool bDontB return; } - if (GetClientTeam(client) == TEAM_INFECTED) + if (GetClientTeam(client) == TEAM_ZOMBIE) { int zombieclass = GetInfectedClass(client); if (zombieclass == L4D2Infected_Tank) @@ -170,7 +166,7 @@ public void Event_AbilityUse(Event hEvent, const char[] sEventName, bool bDontBr int userid = hEvent.GetInt("userid"); int client = GetClientOfUserId(userid); - if (!IsClientInGame(client) || GetClientTeam(client) != TEAM_INFECTED) + if (!IsClientInGame(client) || GetClientTeam(client) != TEAM_ZOMBIE) { return; } @@ -232,7 +228,7 @@ public void Event_PlayerHurt(Event hEvent, const char[] sEventName, bool bDontBr return; } - if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_INFECTED) + if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_ZOMBIE) { int zombieclass = GetInfectedClass(victim); if (zombieclass == L4D2Infected_Tank) @@ -300,7 +296,7 @@ public void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontB if (!IsClientInGame(attacker)) { - if (GetClientTeam(victim) == TEAM_INFECTED) + if (GetClientTeam(victim) == TEAM_ZOMBIE) { ClearDamage(victim); } @@ -308,7 +304,7 @@ public void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontB return; } - if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_INFECTED) + if (GetClientTeam(attacker) == TEAM_SURVIVOR && GetClientTeam(victim) == TEAM_ZOMBIE) { int zombieclass = GetInfectedClass(victim); if (zombieclass == L4D2Infected_Tank) @@ -481,7 +477,7 @@ public void Event_PlayerDeath(Event hEvent, const char[] sEventName, bool bDontB } } - if (GetClientTeam(victim) == TEAM_INFECTED) + if (GetClientTeam(victim) == TEAM_ZOMBIE) { ClearDamage(victim); } @@ -553,7 +549,7 @@ public void Event_PlayerShoved(Event hEvent, const char[] sEventName, bool bDont } int victim = GetClientOfUserId(hEvent.GetInt("userid")); - if (victim == 0 || !IsClientInGame(victim) || GetClientTeam(victim) != TEAM_INFECTED) + if (victim == 0 || !IsClientInGame(victim) || GetClientTeam(victim) != TEAM_ZOMBIE) { return; } diff --git a/addons/sourcemod/scripting/l4d_fix_common_shove.sp b/addons/sourcemod/scripting/l4d_fix_common_shove.sp index 7389e2db9..2ac5958d7 100644 --- a/addons/sourcemod/scripting/l4d_fix_common_shove.sp +++ b/addons/sourcemod/scripting/l4d_fix_common_shove.sp @@ -4,10 +4,10 @@ #include #include #include -#include +#include #include -#define PLUGIN_VERSION "1.3" +#define PLUGIN_VERSION "1.3.1" public Plugin myinfo = { diff --git a/addons/sourcemod/scripting/l4d_fix_punch_block.sp b/addons/sourcemod/scripting/l4d_fix_punch_block.sp index df8e39877..66608a126 100644 --- a/addons/sourcemod/scripting/l4d_fix_punch_block.sp +++ b/addons/sourcemod/scripting/l4d_fix_punch_block.sp @@ -4,9 +4,9 @@ #include #include #include -#include +#include -#define PLUGIN_VERSION "1.2.1" +#define PLUGIN_VERSION "1.2.2" public Plugin myinfo = { diff --git a/addons/sourcemod/scripting/left4dhooks_test.sp b/addons/sourcemod/scripting/left4dhooks_test.sp index 88902edd2..151f6842b 100644 --- a/addons/sourcemod/scripting/left4dhooks_test.sp +++ b/addons/sourcemod/scripting/left4dhooks_test.sp @@ -5010,8 +5010,6 @@ public Action L4D2_OnChooseVictim_Pre(int specialInfected, int &lastTarget) // return Plugin_Changed; // No target - the special will stand still. - return Plugin_Handled; - return Plugin_Continue; } diff --git a/addons/sourcemod/scripting/pill_passer.sp b/addons/sourcemod/scripting/pill_passer.sp index bf5397c3b..21c029d9a 100644 --- a/addons/sourcemod/scripting/pill_passer.sp +++ b/addons/sourcemod/scripting/pill_passer.sp @@ -9,7 +9,6 @@ #undef REQUIRE_PLUGIN #include -#define ENTITY_MAX_NAME_LENGTH 64 #define USE_GIVEPLAYERITEM 0 // Works correctly only in the latest version of sourcemod 1.11 (GivePlayerItem sourcemod native) public Plugin myinfo = @@ -17,7 +16,7 @@ public Plugin myinfo = name = "Easier Pill Passer", author = "CanadaRox, A1m`, Forgetest", description = "Lets players pass pills and adrenaline with +reload when they are holding one of those items", - version = "1.6.1", + version = "1.6.2", url = "https://github.com/SirPlease/L4D2-Competitive-Rework" }; diff --git a/addons/sourcemod/scripting/weapon_spawn_duplicate_fix.sp b/addons/sourcemod/scripting/weapon_spawn_duplicate_fix.sp index a53f2d7d3..d9a1e77bb 100644 --- a/addons/sourcemod/scripting/weapon_spawn_duplicate_fix.sp +++ b/addons/sourcemod/scripting/weapon_spawn_duplicate_fix.sp @@ -1,8 +1,9 @@ +#pragma semicolon 1 +#pragma newdecls required + #include #include #include - -#define REQUIRE_EXTENSIONS #include // Fixed issues: @@ -108,6 +109,6 @@ public Plugin myinfo = name = "[L4D2] Weapon Duplicate Fix", author = "shqke", description = "Prevents a weapon to be taken from weapon spawn if its item counter has hit a zero", - version = "1.1", + version = "1.1.1", url = "https://github.com/shqke/sp_public" }; \ No newline at end of file