diff --git a/addons/sourcemod/data/protected_plugins_list.txt b/addons/sourcemod/data/protected_plugins_list.txt new file mode 100644 index 000000000..ba0d67897 --- /dev/null +++ b/addons/sourcemod/data/protected_plugins_list.txt @@ -0,0 +1,12 @@ +admin-flatfile +adminhelp +adminmenu +basebans +basecomm +basecommands +command_buffer +funcommands +l4d2lib +l4d_pause_message +left4dhooks +playercommands \ No newline at end of file diff --git a/addons/sourcemod/plugins/fixes/command_buffer.smx b/addons/sourcemod/plugins/command_buffer.smx similarity index 100% rename from addons/sourcemod/plugins/fixes/command_buffer.smx rename to addons/sourcemod/plugins/command_buffer.smx diff --git a/addons/sourcemod/plugins/confoglcompmod.smx b/addons/sourcemod/plugins/confoglcompmod.smx index eb03298f1..8c9968d9f 100644 Binary files a/addons/sourcemod/plugins/confoglcompmod.smx and b/addons/sourcemod/plugins/confoglcompmod.smx differ diff --git a/addons/sourcemod/plugins/optional/l4d2lib.smx b/addons/sourcemod/plugins/l4d2lib.smx similarity index 100% rename from addons/sourcemod/plugins/optional/l4d2lib.smx rename to addons/sourcemod/plugins/l4d2lib.smx diff --git a/addons/sourcemod/plugins/match_vote.smx b/addons/sourcemod/plugins/match_vote.smx index 03036ebb7..722a389b9 100644 Binary files a/addons/sourcemod/plugins/match_vote.smx and b/addons/sourcemod/plugins/match_vote.smx differ diff --git a/addons/sourcemod/plugins/optional/predictable_unloader.smx b/addons/sourcemod/plugins/optional/predictable_unloader.smx deleted file mode 100644 index 4c7ddb800..000000000 Binary files a/addons/sourcemod/plugins/optional/predictable_unloader.smx and /dev/null differ diff --git a/addons/sourcemod/plugins/optional/slots_vote.smx b/addons/sourcemod/plugins/optional/slots_vote.smx index ecc3a3dbe..12297290d 100644 Binary files a/addons/sourcemod/plugins/optional/slots_vote.smx and b/addons/sourcemod/plugins/optional/slots_vote.smx differ diff --git a/addons/sourcemod/plugins/plugin_unload_protect.smx b/addons/sourcemod/plugins/plugin_unload_protect.smx new file mode 100644 index 000000000..47fc8eb13 Binary files /dev/null and b/addons/sourcemod/plugins/plugin_unload_protect.smx differ diff --git a/addons/sourcemod/scripting/predictable_unloader.sp b/addons/sourcemod/scripting/archive/predictable_unloader.sp similarity index 100% rename from addons/sourcemod/scripting/predictable_unloader.sp rename to addons/sourcemod/scripting/archive/predictable_unloader.sp diff --git a/addons/sourcemod/scripting/confoglcompmod.sp b/addons/sourcemod/scripting/confoglcompmod.sp index e3b6d7115..d40be4b27 100644 --- a/addons/sourcemod/scripting/confoglcompmod.sp +++ b/addons/sourcemod/scripting/confoglcompmod.sp @@ -1,31 +1,31 @@ #pragma semicolon 1 #pragma newdecls required -#define DEBUG_ALL 0 +#define DEBUG_ALL 0 -#define PLUGIN_VERSION "2.4.3" +#define PLUGIN_VERSION "2.4.3" // Using these macros, you can disable unnecessary modules, // and they will not be included in the plugin at compile time, // to disable, specify 0 for the required module. -#define MODULE_MAPINFO 1 // MapInfo -#define MODULE_WEAPONINFORMATION 1 // WeaponInformation -#define MODULE_REQMATCH 1 // ReqMatch -#define MODULE_CVARSETTINGS 1 // CvarSettings -#define MODULE_GHOSTTANK 1 // GhostTank -#define MODULE_UNRESERVELOBBY 1 // UnreserveLobby -#define MODULE_GHOSTWARP 0 // GhostWarp (plugin l4d2_ghost_warp replaces this functionality) -#define MODULE_PASSWORDSYSTEM 1 // PasswordSystem -#define MODULE_BOTKICK 1 // BotKick -#define MODULE_SCOREMOD 1 // ScoreMod -#define MODULE_FINALESPAWN 1 // FinaleSpawn -#define MODULE_BOSSSPAWNING 1 // BossSpawning -#define MODULE_CLIENTSETTINGS 1 // ClientSettings -#define MODULE_ITEMTRACKING 1 // ItemTracking -#define MODULE_WATERSLOWDOWN 1 // WaterSlowdown (config 'pmelite' uses it) -#define MODULE_UNPROHIBITBOSSES 0 // UnprohibitBosses (duplicate code, plugin 'bossspawningfix' does the same). -#define MODULE_ENTITYREMOVER 0 // EntityRemover (the same can be done with the extension 'stripper'). -#define MODULE_WEAPONCUSTOMIZATION 0 // WeaponCustomization (this is deprecated and disabled, plugin 'l4d_weapon_limits' does the same). +#define MODULE_MAPINFO 1 // MapInfo +#define MODULE_WEAPONINFORMATION 1 // WeaponInformation +#define MODULE_REQMATCH 1 // ReqMatch +#define MODULE_CVARSETTINGS 1 // CvarSettings +#define MODULE_GHOSTTANK 1 // GhostTank +#define MODULE_UNRESERVELOBBY 1 // UnreserveLobby +#define MODULE_GHOSTWARP 0 // GhostWarp (plugin l4d2_ghost_warp replaces this functionality) +#define MODULE_PASSWORDSYSTEM 1 // PasswordSystem +#define MODULE_BOTKICK 1 // BotKick +#define MODULE_SCOREMOD 1 // ScoreMod +#define MODULE_FINALESPAWN 1 // FinaleSpawn +#define MODULE_BOSSSPAWNING 1 // BossSpawning +#define MODULE_CLIENTSETTINGS 1 // ClientSettings +#define MODULE_ITEMTRACKING 1 // ItemTracking +#define MODULE_WATERSLOWDOWN 1 // WaterSlowdown (config 'pmelite' uses it) +#define MODULE_UNPROHIBITBOSSES 0 // UnprohibitBosses (duplicate code, plugin 'bossspawningfix' does the same). +#define MODULE_ENTITYREMOVER 0 // EntityRemover (the same can be done with the extension 'stripper'). +#define MODULE_WEAPONCUSTOMIZATION 0 // WeaponCustomization (this is deprecated and disabled, plugin 'l4d_weapon_limits' does the same). #include #include @@ -44,250 +44,250 @@ #include "confoglcompmod/includes/customtags.sp" #if MODULE_MAPINFO - #include "confoglcompmod/MapInfo.sp" + #include "confoglcompmod/MapInfo.sp" #endif #if MODULE_WEAPONINFORMATION - #include "confoglcompmod/WeaponInformation.sp" + #include "confoglcompmod/WeaponInformation.sp" #endif #if MODULE_REQMATCH - #include "confoglcompmod/ReqMatch.sp" + #include "confoglcompmod/ReqMatch.sp" #endif #if MODULE_CVARSETTINGS - #include "confoglcompmod/CvarSettings.sp" + #include "confoglcompmod/CvarSettings.sp" #endif #if MODULE_GHOSTTANK - #include "confoglcompmod/GhostTank.sp" + #include "confoglcompmod/GhostTank.sp" #endif #if MODULE_UNRESERVELOBBY - #include "confoglcompmod/UnreserveLobby.sp" + #include "confoglcompmod/UnreserveLobby.sp" #endif #if MODULE_GHOSTWARP - #include "confoglcompmod/GhostWarp.sp" + #include "confoglcompmod/GhostWarp.sp" #endif #if MODULE_PASSWORDSYSTEM - #include "confoglcompmod/PasswordSystem.sp" + #include "confoglcompmod/PasswordSystem.sp" #endif #if MODULE_BOTKICK - #include "confoglcompmod/BotKick.sp" + #include "confoglcompmod/BotKick.sp" #endif #if MODULE_SCOREMOD - #include "confoglcompmod/ScoreMod.sp" + #include "confoglcompmod/ScoreMod.sp" #endif #if MODULE_FINALESPAWN - #include "confoglcompmod/FinaleSpawn.sp" + #include "confoglcompmod/FinaleSpawn.sp" #endif #if MODULE_BOSSSPAWNING - #include "confoglcompmod/BossSpawning.sp" + #include "confoglcompmod/BossSpawning.sp" #endif #if MODULE_CLIENTSETTINGS - #include "confoglcompmod/ClientSettings.sp" + #include "confoglcompmod/ClientSettings.sp" #endif #if MODULE_ITEMTRACKING - #include "confoglcompmod/ItemTracking.sp" + #include "confoglcompmod/ItemTracking.sp" #endif #if MODULE_WATERSLOWDOWN - #include "confoglcompmod/WaterSlowdown.sp" + #include "confoglcompmod/WaterSlowdown.sp" #endif #if MODULE_UNPROHIBITBOSSES - #include "confoglcompmod/UnprohibitBosses.sp" + #include "confoglcompmod/UnprohibitBosses.sp" #endif #if MODULE_ENTITYREMOVER - #include "confoglcompmod/EntityRemover.sp" + #include "confoglcompmod/EntityRemover.sp" #endif #if MODULE_WEAPONCUSTOMIZATION - #include "confoglcompmod/WeaponCustomization.sp" + #include "confoglcompmod/WeaponCustomization.sp" #endif public Plugin myinfo = { - name = "Confogl's Competitive Mod", - author = "Confogl Team, A1m`", - description = "A competitive mod for L4D2", - version = PLUGIN_VERSION, - url = "https://github.com/L4D-Community/L4D2-Competitive-Framework" + name = "Confogl's Competitive Mod", + author = "Confogl Team, A1m`", + description = "A competitive mod for L4D2", + version = PLUGIN_VERSION, + url = "https://github.com/L4D-Community/L4D2-Competitive-Framework" }; public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) { - // Plugin functions - Configs_APL(); // configs + // Plugin functions + Configs_APL(); // configs - // Modules + // Modules #if MODULE_REQMATCH - RM_APL(); // ReqMatch + RM_APL(); // ReqMatch #endif #if MODULE_MAPINFO - MI_APL(); // MapInfo + MI_APL(); // MapInfo #endif #if MODULE_SCOREMOD - SM_APL(); + SM_APL(); #endif - // Other - RegPluginLibrary("confogl"); - return APLRes_Success; + // Other + RegPluginLibrary("confogl"); + return APLRes_Success; } public void OnPluginStart() { - // Plugin functions - Fns_OnModuleStart(); // functions - Debug_OnModuleStart(); // debug - Configs_OnModuleStart(); // configs - SI_OnModuleStart(); // survivorindex - CT_OnModuleStart(); // customtags - - // Modules + // Plugin functions + Fns_OnModuleStart(); // functions + Debug_OnModuleStart(); // debug + Configs_OnModuleStart(); // configs + SI_OnModuleStart(); // survivorindex + CT_OnModuleStart(); // customtags + + // Modules #if MODULE_MAPINFO - MI_OnModuleStart(); // MapInfo + MI_OnModuleStart(); // MapInfo #endif #if MODULE_WEAPONINFORMATION - WI_OnModuleStart(); // WeaponInformation + WI_OnModuleStart(); // WeaponInformation #endif #if MODULE_REQMATCH - RM_OnModuleStart(); // ReqMatch + RM_OnModuleStart(); // ReqMatch #endif #if MODULE_CVARSETTINGS - CVS_OnModuleStart(); // CvarSettings + CVS_OnModuleStart(); // CvarSettings #endif #if MODULE_PASSWORDSYSTEM - PS_OnModuleStart(); // PasswordSystem + PS_OnModuleStart(); // PasswordSystem #endif #if MODULE_UNRESERVELOBBY - UL_OnModuleStart(); // UnreserveLobby + UL_OnModuleStart(); // UnreserveLobby #endif #if MODULE_ENTITYREMOVER - ER_OnModuleStart(); // EntityRemover + ER_OnModuleStart(); // EntityRemover #endif #if MODULE_GHOSTWARP - GW_OnModuleStart(); // GhostWarp + GW_OnModuleStart(); // GhostWarp #endif #if MODULE_WATERSLOWDOWN - WS_OnModuleStart(); // WaterSlowdown + WS_OnModuleStart(); // WaterSlowdown #endif #if MODULE_GHOSTTANK - GT_OnModuleStart(); // GhostTank + GT_OnModuleStart(); // GhostTank #endif #if MODULE_UNPROHIBITBOSSES - UB_OnModuleStart(); // UnprohibitBosses + UB_OnModuleStart(); // UnprohibitBosses #endif #if MODULE_BOTKICK - BK_OnModuleStart(); // BotKick + BK_OnModuleStart(); // BotKick #endif #if MODULE_SCOREMOD - SM_OnModuleStart(); // ScoreMod + SM_OnModuleStart(); // ScoreMod #endif #if MODULE_FINALESPAWN - FS_OnModuleStart(); // FinaleSpawn + FS_OnModuleStart(); // FinaleSpawn #endif #if MODULE_BOSSSPAWNING - BS_OnModuleStart(); // BossSpawning + BS_OnModuleStart(); // BossSpawning #endif #if MODULE_WEAPONCUSTOMIZATION - WC_OnModuleStart(); // WeaponCustomization + WC_OnModuleStart(); // WeaponCustomization #endif #if MODULE_CLIENTSETTINGS - CLS_OnModuleStart(); // ClientSettings + CLS_OnModuleStart(); // ClientSettings #endif #if MODULE_ITEMTRACKING - IT_OnModuleStart(); // ItemTracking + IT_OnModuleStart(); // ItemTracking #endif - // Other - AddCustomServerTag("confogl"); + // Other + AddCustomServerTag("confogl"); } public void OnPluginEnd() { - // Modules + // Modules #if MODULE_CVARSETTINGS - CVS_OnModuleEnd(); // CvarSettings + CVS_OnModuleEnd(); // CvarSettings #endif #if MODULE_PASSWORDSYSTEM - PS_OnModuleEnd(); // PasswordSystem + PS_OnModuleEnd(); // PasswordSystem #endif #if MODULE_ENTITYREMOVER - ER_OnModuleEnd(); // EntityRemover + ER_OnModuleEnd(); // EntityRemover #endif #if MODULE_SCOREMOD - SM_OnModuleEnd(); // ScoreMod + SM_OnModuleEnd(); // ScoreMod #endif #if MODULE_WATERSLOWDOWN - WS_OnModuleEnd(); // WaterSlowdown + WS_OnModuleEnd(); // WaterSlowdown #endif #if MODULE_MAPINFO - MI_OnModuleEnd(); // MapInfo + MI_OnModuleEnd(); // MapInfo #endif - // Other - RemoveCustomServerTag("confogl"); + // Other + RemoveCustomServerTag("confogl"); } #if MODULE_MAPINFO || MODULE_REQMATCH || MODULE_SCOREMOD || MODULE_BOSSSPAWNING || MODULE_ITEMTRACKING public void OnMapStart() { - // Modules - #if MODULE_MAPINFO - MI_OnMapStart(); // MapInfo - #endif - - #if MODULE_REQMATCH - RM_OnMapStart(); // ReqMatch - #endif - - #if MODULE_SCOREMOD - SM_OnMapStart(); // ScoreMod - #endif - - #if MODULE_BOSSSPAWNING - BS_OnMapStart(); // BossSpawning - #endif - - #if MODULE_ITEMTRACKING - IT_OnMapStart(); // ItemTracking - #endif + // Modules + #if MODULE_MAPINFO + MI_OnMapStart(); // MapInfo + #endif + + #if MODULE_REQMATCH + RM_OnMapStart(); // ReqMatch + #endif + + #if MODULE_SCOREMOD + SM_OnMapStart(); // ScoreMod + #endif + + #if MODULE_BOSSSPAWNING + BS_OnMapStart(); // BossSpawning + #endif + + #if MODULE_ITEMTRACKING + IT_OnMapStart(); // ItemTracking + #endif } #endif @@ -295,22 +295,22 @@ public void OnMapStart() public void OnMapEnd() { - // Modules - #if MODULE_MAPINFO - MI_OnMapEnd(); // MapInfo - #endif - - #if MODULE_WEAPONINFORMATION - WI_OnMapEnd(); // WeaponInformation - #endif - - #if MODULE_PASSWORDSYSTEM - PS_OnMapEnd(); // PasswordSystem - #endif - - #if MODULE_WATERSLOWDOWN - WS_OnMapEnd(); // WaterSlowdown - #endif + // Modules + #if MODULE_MAPINFO + MI_OnMapEnd(); // MapInfo + #endif + + #if MODULE_WEAPONINFORMATION + WI_OnMapEnd(); // WeaponInformation + #endif + + #if MODULE_PASSWORDSYSTEM + PS_OnMapEnd(); // PasswordSystem + #endif + + #if MODULE_WATERSLOWDOWN + WS_OnMapEnd(); // WaterSlowdown + #endif } #endif @@ -318,8 +318,8 @@ public void OnMapEnd() public void OnConfigsExecuted() { - // Modules - CVS_OnConfigsExecuted(); // CvarSettings + // Modules + CVS_OnConfigsExecuted(); // CvarSettings } #endif @@ -327,8 +327,8 @@ public void OnConfigsExecuted() public void OnClientDisconnect(int client) { - // Modules - RM_OnClientDisconnect(client); // ReqMatch + // Modules + RM_OnClientDisconnect(client); // ReqMatch } #endif @@ -336,13 +336,13 @@ public void OnClientDisconnect(int client) public bool OnClientConnect(int client, char[] rejectmsg, int maxlen) { - // Modules - if (!BK_OnClientConnect(client)) - { // BotKick - return false; - } + // Modules + if (!BK_OnClientConnect(client)) + { // BotKick + return false; + } - return true; + return true; } #endif @@ -350,22 +350,22 @@ public bool OnClientConnect(int client, char[] rejectmsg, int maxlen) public void OnClientPutInServer(int client) { - // Modules - #if MODULE_REQMATCH - RM_OnClientPutInServer(); // ReqMatch - #endif - - #if MODULE_UNRESERVELOBBY - UL_OnClientPutInServer(); // UnreserveLobby - #endif - - #if MODULE_PASSWORDSYSTEM - PS_OnClientPutInServer(client); // PasswordSystem - #endif - - #if MODULE_FINALESPAWN - FS_OnClientPutInServer(client); // FinaleSpawn - #endif + // Modules + #if MODULE_REQMATCH + RM_OnClientPutInServer(); // ReqMatch + #endif + + #if MODULE_UNRESERVELOBBY + UL_OnClientPutInServer(); // UnreserveLobby + #endif + + #if MODULE_PASSWORDSYSTEM + PS_OnClientPutInServer(client); // PasswordSystem + #endif + + #if MODULE_FINALESPAWN + FS_OnClientPutInServer(client); // FinaleSpawn + #endif } #endif @@ -375,23 +375,23 @@ public void OnClientPutInServer(int client) public void OnGameFrame() { - // Modules - WS_OnGameFrame(); // WaterSlowdown + // Modules + WS_OnGameFrame(); // WaterSlowdown } #endif #if MODULE_GHOSTWARP public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, - int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]) + int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2]) { - // Modules - if (GW_OnPlayerRunCmd(client, buttons)) - { // GhostWarp - return Plugin_Handled; - } + // Modules + if (GW_OnPlayerRunCmd(client, buttons)) + { // GhostWarp + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; } #endif @@ -401,13 +401,13 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 public Action L4D_OnCThrowActivate(int ability) { - // Modules - if (GT_OnCThrowActivate() == Plugin_Handled) - { // GhostTank - return Plugin_Handled; - } + // Modules + if (GT_OnCThrowActivate() == Plugin_Handled) + { // GhostTank + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; } #endif @@ -415,13 +415,13 @@ public Action L4D_OnCThrowActivate(int ability) public Action L4D_OnSpawnTank(const float vector[3], const float qangle[3]) { - // Modules - if (GT_OnTankSpawn_Forward() == Plugin_Handled) - { // GhostTank - return Plugin_Handled; - } + // Modules + if (GT_OnTankSpawn_Forward() == Plugin_Handled) + { // GhostTank + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; } #endif @@ -429,8 +429,8 @@ public Action L4D_OnSpawnTank(const float vector[3], const float qangle[3]) public void L4D_OnSpawnTank_Post(int client, const float vecPos[3], const float vecAng[3]) { - // Modules - BS_OnTankSpawnPost_Forward(client); // BossSpawning + // Modules + BS_OnTankSpawnPost_Forward(client); // BossSpawning } #endif @@ -438,13 +438,13 @@ public void L4D_OnSpawnTank_Post(int client, const float vecPos[3], const float public Action L4D_OnSpawnMob(int &amount) { - // Modules - if (GT_OnSpawnMob_Forward(amount) == Plugin_Handled) - { // GhostTank - return Plugin_Handled; - } + // Modules + if (GT_OnSpawnMob_Forward(amount) == Plugin_Handled) + { // GhostTank + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; } #endif @@ -452,13 +452,13 @@ public Action L4D_OnSpawnMob(int &amount) public Action L4D_OnTryOfferingTankBot(int tank_index, bool &enterStasis) { - // Modules - if (GT_OnTryOfferingTankBot(enterStasis) == Plugin_Handled) - { // GhostTank - return Plugin_Handled; - } + // Modules + if (GT_OnTryOfferingTankBot(enterStasis) == Plugin_Handled) + { // GhostTank + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; } #endif @@ -466,13 +466,13 @@ public Action L4D_OnTryOfferingTankBot(int tank_index, bool &enterStasis) public Action L4D_OnGetMissionVSBossSpawning(float &spawn_pos_min, float &spawn_pos_max, float &tank_chance, float &witch_chance) { - // Modules - if (UB_OnGetMissionVSBossSpawning() == Plugin_Handled) - { // UnprohibitBosses - return Plugin_Handled; - } + // Modules + if (UB_OnGetMissionVSBossSpawning() == Plugin_Handled) + { // UnprohibitBosses + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; } #endif @@ -480,41 +480,41 @@ public Action L4D_OnGetMissionVSBossSpawning(float &spawn_pos_min, float &spawn_ public Action L4D_OnGetScriptValueInt(const char[] key, int &retVal) { - // Modules - if (UB_OnGetScriptValueInt(key, retVal) == Plugin_Handled) - { // UnprohibitBosses - return Plugin_Handled; - } + // Modules + if (UB_OnGetScriptValueInt(key, retVal) == Plugin_Handled) + { // UnprohibitBosses + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; } #endif public Action L4D_OnFirstSurvivorLeftSafeArea(int client) { - if (IsPluginEnabled()) - { - CreateTimer(0.1, OFSLA_ForceMobSpawnTimer); - } + if (IsPluginEnabled()) + { + CreateTimer(0.1, OFSLA_ForceMobSpawnTimer); + } - return Plugin_Continue; + return Plugin_Continue; } public Action OFSLA_ForceMobSpawnTimer(Handle hTimer) { - // Workaround to make tank horde blocking always work - // Makes the first horde always start 100s after survivors leave saferoom - static ConVar hCvarMobSpawnTimeMin = null; - static ConVar hCvarMobSpawnTimeMax = null; + // Workaround to make tank horde blocking always work + // Makes the first horde always start 100s after survivors leave saferoom + static ConVar hCvarMobSpawnTimeMin = null; + static ConVar hCvarMobSpawnTimeMax = null; - if (hCvarMobSpawnTimeMin == null) - { - hCvarMobSpawnTimeMin = FindConVar("z_mob_spawn_min_interval_normal"); - hCvarMobSpawnTimeMax = FindConVar("z_mob_spawn_max_interval_normal"); - } + if (hCvarMobSpawnTimeMin == null) + { + hCvarMobSpawnTimeMin = FindConVar("z_mob_spawn_min_interval_normal"); + hCvarMobSpawnTimeMax = FindConVar("z_mob_spawn_max_interval_normal"); + } - float fRand = GetRandomFloat(hCvarMobSpawnTimeMin.FloatValue, hCvarMobSpawnTimeMax.FloatValue); - L4D2_CTimerStart(L4D2CT_MobSpawnTimer, fRand); + float fRand = GetRandomFloat(hCvarMobSpawnTimeMin.FloatValue, hCvarMobSpawnTimeMax.FloatValue); + L4D2_CTimerStart(L4D2CT_MobSpawnTimer, fRand); - return Plugin_Stop; + return Plugin_Stop; } diff --git a/addons/sourcemod/scripting/confoglcompmod/BossSpawning.sp b/addons/sourcemod/scripting/confoglcompmod/BossSpawning.sp index e10719d62..5c94660bd 100644 --- a/addons/sourcemod/scripting/confoglcompmod/BossSpawning.sp +++ b/addons/sourcemod/scripting/confoglcompmod/BossSpawning.sp @@ -1,213 +1,213 @@ #if defined __boss_spawning_included - #endinput + #endinput #endif #define __boss_spawning_included -#define DEBUG_BS 0 -#define BS_MODULE_NAME "BossSpawning" +#define DEBUG_BS 0 +#define BS_MODULE_NAME "BossSpawning" -#define MAX_TANKS 5 -#define MAX_WITCHES 5 -#define ROUND_MAX_COUNT 2 +#define MAX_TANKS 5 +#define MAX_WITCHES 5 +#define ROUND_MAX_COUNT 2 static char - BS_sMap[64] = "\0"; + BS_sMap[64] = "\0"; static bool - BS_bEnabled = true, - BS_bIsFirstRound = true, - BS_bDeleteWitches = false, - BS_bFinaleStarted = false; + BS_bEnabled = true, + BS_bIsFirstRound = true, + BS_bDeleteWitches = false, + BS_bFinaleStarted = false; static int - BS_iTankCount[ROUND_MAX_COUNT] = {0, ...}, - BS_iWitchCount[ROUND_MAX_COUNT] = {0, ...}; + BS_iTankCount[ROUND_MAX_COUNT] = {0, ...}, + BS_iWitchCount[ROUND_MAX_COUNT] = {0, ...}; static float - BS_fTankSpawn[MAX_TANKS][3], - BS_fWitchSpawn[MAX_WITCHES][2][3]; + BS_fTankSpawn[MAX_TANKS][3], + BS_fWitchSpawn[MAX_WITCHES][2][3]; static ConVar - BS_hEnabled = null; + BS_hEnabled = null; void BS_OnModuleStart() { - BS_hEnabled = CreateConVarEx("lock_boss_spawns", "1", "Enables forcing same coordinates for tank and witch spawns", _, true, 0.0, true, 1.0); + BS_hEnabled = CreateConVarEx("lock_boss_spawns", "1", "Enables forcing same coordinates for tank and witch spawns", _, true, 0.0, true, 1.0); - BS_bEnabled = BS_hEnabled.BoolValue; - BS_hEnabled.AddChangeHook(BS_ConVarChange); + BS_bEnabled = BS_hEnabled.BoolValue; + BS_hEnabled.AddChangeHook(BS_ConVarChange); - HookEvent("witch_spawn", BS_WitchSpawn); - HookEvent("round_end", BS_RoundEnd, EventHookMode_PostNoCopy); - HookEvent("finale_start", BS_FinaleStart, EventHookMode_PostNoCopy); + HookEvent("witch_spawn", BS_WitchSpawn); + HookEvent("round_end", BS_RoundEnd, EventHookMode_PostNoCopy); + HookEvent("finale_start", BS_FinaleStart, EventHookMode_PostNoCopy); - GetCurrentMap(BS_sMap, sizeof(BS_sMap)); + GetCurrentMap(BS_sMap, sizeof(BS_sMap)); } void BS_OnMapStart() { - BS_bIsFirstRound = true; - BS_bFinaleStarted = false; + BS_bIsFirstRound = true; + BS_bFinaleStarted = false; - for (int i = 0; i < ROUND_MAX_COUNT; i++) { - BS_iTankCount[i] = 0; - BS_iWitchCount[i] = 0; - } + for (int i = 0; i < ROUND_MAX_COUNT; i++) { + BS_iTankCount[i] = 0; + BS_iWitchCount[i] = 0; + } - GetCurrentMap(BS_sMap, sizeof(BS_sMap)); + GetCurrentMap(BS_sMap, sizeof(BS_sMap)); } public void BS_ConVarChange(ConVar convar, const char[] oldValue, const char[] newValue) { - BS_bEnabled = BS_hEnabled.BoolValue; + BS_bEnabled = BS_hEnabled.BoolValue; } public void BS_WitchSpawn(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!BS_bEnabled || !IsPluginEnabled()) { - return; - } - - int iWitch = hEvent.GetInt("witchid"); - - if (BS_bDeleteWitches) { - // Used to delete round2 extra witches, which spawn on round start instead of by flow - KillEntity(iWitch); - - return; - } - - // Can't track more witches if our witch array is full - if (BS_iWitchCount[view_as(!BS_bIsFirstRound)] >= MAX_WITCHES) { - Debug_LogError(BS_MODULE_NAME, "Failed to save a large number of witches to the array. Count: %d, Max: %d", \ - BS_iWitchCount[view_as(!BS_bIsFirstRound)], MAX_WITCHES); - return; - } - - if (BS_bIsFirstRound) { - // If it's the first round, track our witch. - GetEntPropVector(iWitch, Prop_Send, "m_vecOrigin", BS_fWitchSpawn[BS_iWitchCount[0]][0]); - GetEntPropVector(iWitch, Prop_Send, "m_angRotation", BS_fWitchSpawn[BS_iWitchCount[0]][1]); - BS_iWitchCount[0]++; - } else if (BS_iWitchCount[0] > BS_iWitchCount[1]) { - // Until we have found the same number of witches as from round1, teleport them to round1 locations - TeleportEntity(iWitch, BS_fWitchSpawn[BS_iWitchCount[1]][0], BS_fWitchSpawn[BS_iWitchCount[1]][1], NULL_VECTOR); - BS_iWitchCount[1]++; - } + if (!BS_bEnabled || !IsPluginEnabled()) { + return; + } + + int iWitch = hEvent.GetInt("witchid"); + + if (BS_bDeleteWitches) { + // Used to delete round2 extra witches, which spawn on round start instead of by flow + KillEntity(iWitch); + + return; + } + + // Can't track more witches if our witch array is full + if (BS_iWitchCount[view_as(!BS_bIsFirstRound)] >= MAX_WITCHES) { + Debug_LogError(BS_MODULE_NAME, "Failed to save a large number of witches to the array. Count: %d, Max: %d", \ + BS_iWitchCount[view_as(!BS_bIsFirstRound)], MAX_WITCHES); + return; + } + + if (BS_bIsFirstRound) { + // If it's the first round, track our witch. + GetEntPropVector(iWitch, Prop_Send, "m_vecOrigin", BS_fWitchSpawn[BS_iWitchCount[0]][0]); + GetEntPropVector(iWitch, Prop_Send, "m_angRotation", BS_fWitchSpawn[BS_iWitchCount[0]][1]); + BS_iWitchCount[0]++; + } else if (BS_iWitchCount[0] > BS_iWitchCount[1]) { + // Until we have found the same number of witches as from round1, teleport them to round1 locations + TeleportEntity(iWitch, BS_fWitchSpawn[BS_iWitchCount[1]][0], BS_fWitchSpawn[BS_iWitchCount[1]][1], NULL_VECTOR); + BS_iWitchCount[1]++; + } } void BS_OnTankSpawnPost_Forward(int iTankClient) { - if (!BS_bEnabled || !IsPluginEnabled()) { - return; - } - - // Don't touch tanks on finale events - if (BS_bFinaleStarted) { - return; - } - - // Don't track tank spawns on c5m5 or tank can spawn behind other team. - if (strcmp(BS_sMap, "c5m5_bridge") == 0) { - return; - } - - if (GetMapValueInt("tank_z_fix")) { - FixZDistance(iTankClient); // fix stuck tank spawns, ex c1m1 - } - - // If we reach MAX_TANKS, we don't have any room to store their locations - if (BS_iTankCount[view_as(!BS_bIsFirstRound)] >= MAX_TANKS) { - Debug_LogError(BS_MODULE_NAME, "Failed to save a large number of tanks to the array. Count: %d, Max: %d", \ - BS_iTankCount[view_as(!BS_bIsFirstRound)], MAX_TANKS); - return; - } - - if (DEBUG_BS || IsDebugEnabled()) { - LogMessage("[%s] Tracking this tank spawn. Currently, %d tanks", BS_MODULE_NAME, BS_iTankCount[view_as(!BS_bIsFirstRound)]); - } - - if (BS_bIsFirstRound) { - GetClientAbsOrigin(iTankClient, BS_fTankSpawn[BS_iTankCount[0]]); - if (DEBUG_BS || IsDebugEnabled()) { - LogMessage("[%s] Saving tank at %f %f %f", \ - BS_MODULE_NAME, BS_fTankSpawn[BS_iTankCount[0]][0], BS_fTankSpawn[BS_iTankCount[0]][1], BS_fTankSpawn[BS_iTankCount[0]][2]); - } - - BS_iTankCount[0]++; - } else if (BS_iTankCount[0] > BS_iTankCount[1]) { - TeleportEntity(iTankClient, BS_fTankSpawn[BS_iTankCount[1]], NULL_VECTOR, NULL_VECTOR); - - if (DEBUG_BS || IsDebugEnabled()) { - LogMessage("[%s] Teleporting tank to tank at %f %f %f", \ - BS_MODULE_NAME, BS_fTankSpawn[BS_iTankCount[1]][0], BS_fTankSpawn[BS_iTankCount[1]][1], BS_fTankSpawn[BS_iTankCount[1]][2]); - } - - BS_iTankCount[1]++; - } else if (DEBUG_BS || IsDebugEnabled()) { - LogMessage("[%s] Not first round and not acceptable tank", BS_MODULE_NAME); - LogMessage("[%s] IsFirstRound: %d R1Count: %d R2Count: %d", BS_MODULE_NAME, BS_bIsFirstRound, BS_iTankCount[0], BS_iTankCount[1]); - } + if (!BS_bEnabled || !IsPluginEnabled()) { + return; + } + + // Don't touch tanks on finale events + if (BS_bFinaleStarted) { + return; + } + + // Don't track tank spawns on c5m5 or tank can spawn behind other team. + if (strcmp(BS_sMap, "c5m5_bridge") == 0) { + return; + } + + if (GetMapValueInt("tank_z_fix")) { + FixZDistance(iTankClient); // fix stuck tank spawns, ex c1m1 + } + + // If we reach MAX_TANKS, we don't have any room to store their locations + if (BS_iTankCount[view_as(!BS_bIsFirstRound)] >= MAX_TANKS) { + Debug_LogError(BS_MODULE_NAME, "Failed to save a large number of tanks to the array. Count: %d, Max: %d", \ + BS_iTankCount[view_as(!BS_bIsFirstRound)], MAX_TANKS); + return; + } + + if (DEBUG_BS || IsDebugEnabled()) { + LogMessage("[%s] Tracking this tank spawn. Currently, %d tanks", BS_MODULE_NAME, BS_iTankCount[view_as(!BS_bIsFirstRound)]); + } + + if (BS_bIsFirstRound) { + GetClientAbsOrigin(iTankClient, BS_fTankSpawn[BS_iTankCount[0]]); + if (DEBUG_BS || IsDebugEnabled()) { + LogMessage("[%s] Saving tank at %f %f %f", \ + BS_MODULE_NAME, BS_fTankSpawn[BS_iTankCount[0]][0], BS_fTankSpawn[BS_iTankCount[0]][1], BS_fTankSpawn[BS_iTankCount[0]][2]); + } + + BS_iTankCount[0]++; + } else if (BS_iTankCount[0] > BS_iTankCount[1]) { + TeleportEntity(iTankClient, BS_fTankSpawn[BS_iTankCount[1]], NULL_VECTOR, NULL_VECTOR); + + if (DEBUG_BS || IsDebugEnabled()) { + LogMessage("[%s] Teleporting tank to tank at %f %f %f", \ + BS_MODULE_NAME, BS_fTankSpawn[BS_iTankCount[1]][0], BS_fTankSpawn[BS_iTankCount[1]][1], BS_fTankSpawn[BS_iTankCount[1]][2]); + } + + BS_iTankCount[1]++; + } else if (DEBUG_BS || IsDebugEnabled()) { + LogMessage("[%s] Not first round and not acceptable tank", BS_MODULE_NAME); + LogMessage("[%s] IsFirstRound: %d R1Count: %d R2Count: %d", BS_MODULE_NAME, BS_bIsFirstRound, BS_iTankCount[0], BS_iTankCount[1]); + } } public void BS_RoundEnd(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - BS_bIsFirstRound = false; - BS_bFinaleStarted = false; + BS_bIsFirstRound = false; + BS_bFinaleStarted = false; - if (strcmp(BS_sMap, "c6m1_riverbank") == 0) { - BS_bDeleteWitches = false; - } else { - BS_bDeleteWitches = true; + if (strcmp(BS_sMap, "c6m1_riverbank") == 0) { + BS_bDeleteWitches = false; + } else { + BS_bDeleteWitches = true; - CreateTimer(5.0, BS_WitchTimerReset); - } + CreateTimer(5.0, BS_WitchTimerReset); + } } public void BS_FinaleStart(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - BS_bFinaleStarted = true; + BS_bFinaleStarted = true; } public Action BS_WitchTimerReset(Handle hTimer) { - BS_bDeleteWitches = false; + BS_bDeleteWitches = false; - return Plugin_Stop; + return Plugin_Stop; } static void FixZDistance(int iTankClient) { - int index = 0; - float distance = 99999999999999.9; - float WarpToLocation[3], TankLocation[3], TempSurvivorLocation[3]; - GetClientAbsOrigin(iTankClient, TankLocation); - - if (DEBUG_BS || IsDebugEnabled()) { - LogMessage("[%s] tank z spawn check... Map: %s, Tank Location: %f, %f, %f", BS_MODULE_NAME, BS_sMap, TankLocation[0], TankLocation[1], TankLocation[2]); - } - - for (int i = 0; i < NUM_OF_SURVIVORS; i++) { - distance = GetMapValueFloat("max_tank_z", 99999999999999.9); - index = GetSurvivorIndex(i); - - if (index != 0 && IsValidEntity(index)) { - GetClientAbsOrigin(index, TempSurvivorLocation); - - if (DEBUG_BS || IsDebugEnabled()) { - LogMessage("[%s] Survivor %d Location: %f, %f, %f", BS_MODULE_NAME, i, TempSurvivorLocation[0], TempSurvivorLocation[1], TempSurvivorLocation[2]); - } - - if (FloatAbs(TempSurvivorLocation[2] - TankLocation[2]) > distance) { - GetMapValueVector("tank_warpto", WarpToLocation); - - if (!GetVectorLength(WarpToLocation, true)) { - LogMessage("[%s] tank_warpto missing from mapinfo.txt", BS_MODULE_NAME); - return; - } - - TeleportEntity(iTankClient, WarpToLocation, NULL_VECTOR, NULL_VECTOR); - } - } - } + int index = 0; + float distance = 99999999999999.9; + float WarpToLocation[3], TankLocation[3], TempSurvivorLocation[3]; + GetClientAbsOrigin(iTankClient, TankLocation); + + if (DEBUG_BS || IsDebugEnabled()) { + LogMessage("[%s] tank z spawn check... Map: %s, Tank Location: %f, %f, %f", BS_MODULE_NAME, BS_sMap, TankLocation[0], TankLocation[1], TankLocation[2]); + } + + for (int i = 0; i < NUM_OF_SURVIVORS; i++) { + distance = GetMapValueFloat("max_tank_z", 99999999999999.9); + index = GetSurvivorIndex(i); + + if (index != 0 && IsValidEntity(index)) { + GetClientAbsOrigin(index, TempSurvivorLocation); + + if (DEBUG_BS || IsDebugEnabled()) { + LogMessage("[%s] Survivor %d Location: %f, %f, %f", BS_MODULE_NAME, i, TempSurvivorLocation[0], TempSurvivorLocation[1], TempSurvivorLocation[2]); + } + + if (FloatAbs(TempSurvivorLocation[2] - TankLocation[2]) > distance) { + GetMapValueVector("tank_warpto", WarpToLocation); + + if (!GetVectorLength(WarpToLocation, true)) { + LogMessage("[%s] tank_warpto missing from mapinfo.txt", BS_MODULE_NAME); + return; + } + + TeleportEntity(iTankClient, WarpToLocation, NULL_VECTOR, NULL_VECTOR); + } + } + } } diff --git a/addons/sourcemod/scripting/confoglcompmod/BotKick.sp b/addons/sourcemod/scripting/confoglcompmod/BotKick.sp index a8dd0ff92..f86e13dad 100644 --- a/addons/sourcemod/scripting/confoglcompmod/BotKick.sp +++ b/addons/sourcemod/scripting/confoglcompmod/BotKick.sp @@ -1,115 +1,115 @@ #if defined __bot_kick_included - #endinput + #endinput #endif #define __bot_kick_included -#define BK_MODULE_NAME "BotKick" +#define BK_MODULE_NAME "BotKick" -#define CHECKALLOWEDTIME 0.1 -#define BOTREPLACEVALIDTIME 0.2 +#define CHECKALLOWEDTIME 0.1 +#define BOTREPLACEVALIDTIME 0.2 static const char InfectedNames[][] = { - "smoker", - "boomer", - "hunter", - "spitter", - "jockey", - "charger" + "smoker", + "boomer", + "hunter", + "spitter", + "jockey", + "charger" }; static int - BK_iEnable = 0, - BK_lastvalidbot = -1; + BK_iEnable = 0, + BK_lastvalidbot = -1; static ConVar - BK_hEnable = null; + BK_hEnable = null; void BK_OnModuleStart() { - BK_hEnable = CreateConVarEx( \ - "blockinfectedbots", \ - "1", \ - "Blocks infected bots from joining the game, minus when a tank spawns (1 allows bots from tank spawns, 2 removes all infected bots)", \ - _, true, 0.0, true, 2.0 \ - ); + BK_hEnable = CreateConVarEx( \ + "blockinfectedbots", \ + "1", \ + "Blocks infected bots from joining the game, minus when a tank spawns (1 allows bots from tank spawns, 2 removes all infected bots)", \ + _, true, 0.0, true, 2.0 \ + ); - BK_iEnable = BK_hEnable.IntValue; - BK_hEnable.AddChangeHook(BK_ConVarChange); + BK_iEnable = BK_hEnable.IntValue; + BK_hEnable.AddChangeHook(BK_ConVarChange); - HookEvent("player_bot_replace", BK_PlayerBotReplace); + HookEvent("player_bot_replace", BK_PlayerBotReplace); } public void BK_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - BK_iEnable = BK_hEnable.IntValue; + BK_iEnable = BK_hEnable.IntValue; } bool BK_OnClientConnect(int iClient) { - if (BK_iEnable == 0 || !IsPluginEnabled() || !IsFakeClient(iClient)) { // If the BK_iEnable is 0, we don't do anything - return true; - } + if (BK_iEnable == 0 || !IsPluginEnabled() || !IsFakeClient(iClient)) { // If the BK_iEnable is 0, we don't do anything + return true; + } - // If the client doesn't have a bot infected's name, let it in - if (IsInvalidInfected(iClient)) { - return true; - } + // If the client doesn't have a bot infected's name, let it in + if (IsInvalidInfected(iClient)) { + return true; + } - if (BK_iEnable == 1 && GT_IsTankInPlay()) { // Bots only allowed to try to connect when there's a tank in play. - // Check this bot in CHECKALLOWEDTIME seconds to see if he's supposed to be allowed. - CreateTimer(CHECKALLOWEDTIME, BK_CheckInfBotReplace_Timer, iClient, TIMER_FLAG_NO_MAPCHANGE); - //BK_bAllowBot = false; - return true; - } + if (BK_iEnable == 1 && GT_IsTankInPlay()) { // Bots only allowed to try to connect when there's a tank in play. + // Check this bot in CHECKALLOWEDTIME seconds to see if he's supposed to be allowed. + CreateTimer(CHECKALLOWEDTIME, BK_CheckInfBotReplace_Timer, iClient, TIMER_FLAG_NO_MAPCHANGE); + //BK_bAllowBot = false; + return true; + } - KickClient(iClient, "[Confogl] Kicking infected bot..."); // If all else fails, bots arent allowed and must be kicked + KickClient(iClient, "[Confogl] Kicking infected bot..."); // If all else fails, bots arent allowed and must be kicked - return false; + return false; } public Action BK_CheckInfBotReplace_Timer(Handle hTimer, any iClient) { - if (iClient != BK_lastvalidbot && IsClientInGame(iClient) && IsFakeClient(iClient)) { - KickClient(iClient, "[Confogl] Kicking late infected bot..."); - } else { - BK_lastvalidbot = -1; - } + if (iClient != BK_lastvalidbot && IsClientInGame(iClient) && IsFakeClient(iClient)) { + KickClient(iClient, "[Confogl] Kicking late infected bot..."); + } else { + BK_lastvalidbot = -1; + } - return Plugin_Stop; + return Plugin_Stop; } public void BK_PlayerBotReplace(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!GT_IsTankInPlay()) { - return; - } + if (!GT_IsTankInPlay()) { + return; + } - int iClient = GetClientOfUserId(hEvent.GetInt("player")); + int iClient = GetClientOfUserId(hEvent.GetInt("player")); - if (iClient > 0 && IsClientInGame(iClient) && GetClientTeam(iClient) == L4D2Team_Infected) { - BK_lastvalidbot = GetClientOfUserId(hEvent.GetInt("bot")); - CreateTimer(BOTREPLACEVALIDTIME, BK_CancelValidBot_Timer, _, TIMER_FLAG_NO_MAPCHANGE); - } + if (iClient > 0 && IsClientInGame(iClient) && GetClientTeam(iClient) == L4D2Team_Infected) { + BK_lastvalidbot = GetClientOfUserId(hEvent.GetInt("bot")); + CreateTimer(BOTREPLACEVALIDTIME, BK_CancelValidBot_Timer, _, TIMER_FLAG_NO_MAPCHANGE); + } } public Action BK_CancelValidBot_Timer(Handle hTimer) { - BK_lastvalidbot = -1; + BK_lastvalidbot = -1; - return Plugin_Stop; + return Plugin_Stop; } static bool IsInvalidInfected(int iClient) { - char sBotName[11]; - GetClientName(iClient, sBotName, sizeof(sBotName)); + char sBotName[11]; + GetClientName(iClient, sBotName, sizeof(sBotName)); - for (int i = 0; i < sizeof(InfectedNames); i++) { - if (StrContains(sBotName, InfectedNames[i], false) != -1) { - return false; - } - } + for (int i = 0; i < sizeof(InfectedNames); i++) { + if (StrContains(sBotName, InfectedNames[i], false) != -1) { + return false; + } + } - return true; + return true; } diff --git a/addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp b/addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp index a1685aebb..5cefc9611 100644 --- a/addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp +++ b/addons/sourcemod/scripting/confoglcompmod/ClientSettings.sp @@ -1,457 +1,457 @@ #if defined __client_settings_include - #endinput + #endinput #endif #define __client_settings_include -#define CLS_MODULE_NAME "ClientSettings" +#define CLS_MODULE_NAME "ClientSettings" -#define CLS_CVAR_MAXLEN 64 -#define CLIENT_CHECK_INTERVAL 5.0 +#define CLS_CVAR_MAXLEN 64 +#define CLIENT_CHECK_INTERVAL 5.0 enum /*CLSAction*/ { - CLSA_Kick = 0, - CLSA_Log + CLSA_Kick = 0, + CLSA_Log }; #if SOURCEMOD_V_MINOR > 9 enum struct CLSEntry { - bool CLSE_hasMin; - float CLSE_min; - bool CLSE_hasMax; - float CLSE_max; - int CLSE_action; - char CLSE_cvar[CLS_CVAR_MAXLEN]; + bool CLSE_hasMin; + float CLSE_min; + bool CLSE_hasMax; + float CLSE_max; + int CLSE_action; + char CLSE_cvar[CLS_CVAR_MAXLEN]; } #else enum CLSEntry { - bool:CLSE_hasMin, - Float:CLSE_min, - bool:CLSE_hasMax, - Float:CLSE_max, - CLSE_action, - String:CLSE_cvar[CLS_CVAR_MAXLEN] + bool:CLSE_hasMin, + Float:CLSE_min, + bool:CLSE_hasMax, + Float:CLSE_max, + CLSE_action, + String:CLSE_cvar[CLS_CVAR_MAXLEN] }; #endif static ArrayList - ClientSettingsArray = null; + ClientSettingsArray = null; static Handle - ClientSettingsCheckTimer = null; + ClientSettingsCheckTimer = null; void CLS_OnModuleStart() { #if SOURCEMOD_V_MINOR > 9 - CLSEntry clsetting; + CLSEntry clsetting; #else - CLSEntry clsetting[CLSEntry]; + CLSEntry clsetting[CLSEntry]; #endif - ClientSettingsArray = new ArrayList(sizeof(clsetting)); + ClientSettingsArray = new ArrayList(sizeof(clsetting)); - RegConsoleCmd("confogl_clientsettings", _ClientSettings_Cmd, "List Client settings enforced by confogl"); + RegConsoleCmd("confogl_clientsettings", _ClientSettings_Cmd, "List Client settings enforced by confogl"); - /* Using Server Cmd instead of admin because these shouldn't really be changed on the fly */ - RegServerCmd("confogl_trackclientcvar", _TrackClientCvar_Cmd, "Add a Client CVar to be tracked and enforced by confogl"); - RegServerCmd("confogl_resetclientcvars", _ResetTracking_Cmd, "Remove all tracked client cvars. Cannot be called during matchmode"); - RegServerCmd("confogl_startclientchecking", _StartClientChecking_Cmd, "Start checking and enforcing client cvars tracked by this plugin"); + /* Using Server Cmd instead of admin because these shouldn't really be changed on the fly */ + RegServerCmd("confogl_trackclientcvar", _TrackClientCvar_Cmd, "Add a Client CVar to be tracked and enforced by confogl"); + RegServerCmd("confogl_resetclientcvars", _ResetTracking_Cmd, "Remove all tracked client cvars. Cannot be called during matchmode"); + RegServerCmd("confogl_startclientchecking", _StartClientChecking_Cmd, "Start checking and enforcing client cvars tracked by this plugin"); } -static void ClearAllSettings() +void ClearAllSettings() { - ClientSettingsArray.Clear(); + ClientSettingsArray.Clear(); } /*#if SOURCEMOD_V_MINOR > 9 static void ClearCLSEntry(CLSEntry entry) { - entry.CLSE_hasMin = false; - entry.CLSE_min = 0.0; - entry.CLSE_hasMax = false; - entry.CLSE_max = 0.0; - entry.CLSE_cvar[0] = 0; + entry.CLSE_hasMin = false; + entry.CLSE_min = 0.0; + entry.CLSE_hasMax = false; + entry.CLSE_max = 0.0; + entry.CLSE_cvar[0] = 0; } #else static void ClearCLSEntry(CLSEntry entry[CLSEntry]) { - entry[CLSE_hasMin] = false; - entry[CLSE_min] = 0.0; - entry[CLSE_hasMax] = false; - entry[CLSE_max] = 0.0; - entry[CLSE_cvar][0] = 0; + entry[CLSE_hasMin] = false; + entry[CLSE_min] = 0.0; + entry[CLSE_hasMax] = false; + entry[CLSE_max] = 0.0; + entry[CLSE_cvar][0] = 0; } #endif*/ public Action _CheckClientSettings_Timer(Handle hTimer) { - if (!IsPluginEnabled()) { - if (IsDebugEnabled()) { - LogMessage("[%s] Stopping client settings tracking", CLS_MODULE_NAME); - } + if (!IsPluginEnabled()) { + if (IsDebugEnabled()) { + LogMessage("[%s] Stopping client settings tracking", CLS_MODULE_NAME); + } - ClientSettingsCheckTimer = null; - return Plugin_Stop; - } + ClientSettingsCheckTimer = null; + return Plugin_Stop; + } - EnforceAllCliSettings(); - return Plugin_Continue; + EnforceAllCliSettings(); + return Plugin_Continue; } static void EnforceAllCliSettings() { - for (int i = 1; i <= MaxClients; i++) { - if (IsClientInGame(i) && !IsFakeClient(i)) { - EnforceCliSettings(i); - } - } + for (int i = 1; i <= MaxClients; i++) { + if (IsClientInGame(i) && !IsFakeClient(i)) { + EnforceCliSettings(i); + } + } } static void EnforceCliSettings(int client) { - int iSize = ClientSettingsArray.Length; + int iSize = ClientSettingsArray.Length; #if SOURCEMOD_V_MINOR > 9 - CLSEntry clsetting; - for (int i = 0; i < iSize; i++) { - ClientSettingsArray.GetArray(i, clsetting, sizeof(clsetting)); + CLSEntry clsetting; + for (int i = 0; i < iSize; i++) { + ClientSettingsArray.GetArray(i, clsetting, sizeof(clsetting)); - QueryClientConVar(client, clsetting.CLSE_cvar, _EnforceCliSettings_QueryReply, i); - } + QueryClientConVar(client, clsetting.CLSE_cvar, _EnforceCliSettings_QueryReply, i); + } #else - CLSEntry clsetting[CLSEntry]; - for (int i = 0; i < iSize; i++) { - ClientSettingsArray.GetArray(i, clsetting[0], sizeof(clsetting)); + CLSEntry clsetting[CLSEntry]; + for (int i = 0; i < iSize; i++) { + ClientSettingsArray.GetArray(i, clsetting[0], sizeof(clsetting)); - QueryClientConVar(client, clsetting[CLSE_cvar], _EnforceCliSettings_QueryReply, i); - } + QueryClientConVar(client, clsetting[CLSE_cvar], _EnforceCliSettings_QueryReply, i); + } #endif } public void _EnforceCliSettings_QueryReply(QueryCookie cookie, int client, ConVarQueryResult result, \ - const char[] cvarName, const char[] cvarValue, any value) + const char[] cvarName, const char[] cvarValue, any value) { - if (!IsClientConnected(client) || !IsClientInGame(client) || IsClientInKickQueue(client)) { - // Client disconnected or got kicked already - return; - } + if (!IsClientConnected(client) || !IsClientInGame(client) || IsClientInKickQueue(client)) { + // Client disconnected or got kicked already + return; + } - if (result) { - LogMessage("[%s] Couldn't retrieve cvar %s from %L, kicked from server", CLS_MODULE_NAME, cvarName, client); - KickClient(client, "CVar '%s' protected or missing! Hax?", cvarName); - return; - } + if (result) { + LogMessage("[%s] Couldn't retrieve cvar %s from %L, kicked from server", CLS_MODULE_NAME, cvarName, client); + KickClient(client, "CVar '%s' protected or missing! Hax?", cvarName); + return; + } - float fCvarVal = StringToFloat(cvarValue); - int clsetting_index = value; + float fCvarVal = StringToFloat(cvarValue); + int clsetting_index = value; #if SOURCEMOD_V_MINOR > 9 - CLSEntry clsetting; - ClientSettingsArray.GetArray(clsetting_index, clsetting, sizeof(clsetting)); - - if ((clsetting.CLSE_hasMin && fCvarVal < clsetting.CLSE_min) - || (clsetting.CLSE_hasMax && fCvarVal > clsetting.CLSE_max) - ) { - switch (clsetting.CLSE_action) { - case CLSA_Kick: { - LogMessage("[%s] Kicking %L for bad %s value (%f). Min: %d %f Max: %d %f", \ - CLS_MODULE_NAME, client, cvarName, fCvarVal, clsetting.CLSE_hasMin, \ - clsetting.CLSE_min, clsetting.CLSE_hasMax, clsetting.CLSE_max); - - /*PrintToChatAll("\x01[\x05Confogl\x01] Kicking \x04%L\x01 for having an illegal value for '\x04%s\x01' (\x04%f\x01) !!!", \ - client, cvarName, fCvarVal);*/ - CPrintToChatAll("{blue}[{default}Confogl{blue}] {olive}%L{default} was kicked for having an illegal value for '{green}%s{default}' {blue}({default}%f{blue})", \ - client, cvarName, fCvarVal); - - char kickMessage[256] = "Illegal Client Value for "; - Format(kickMessage, sizeof(kickMessage), "%s%s (%.2f)", kickMessage, cvarName, fCvarVal); - - if (clsetting.CLSE_hasMin) { - Format(kickMessage, sizeof(kickMessage), "%s, Min %.2f", kickMessage, clsetting.CLSE_min); - } - - if (clsetting.CLSE_hasMax) { - Format(kickMessage, sizeof(kickMessage), "%s, Max %.2f", kickMessage, clsetting.CLSE_max); - } - - KickClient(client, "%s", kickMessage); - } - case CLSA_Log: { - LogMessage("[%s] Client %L has a bad %s value (%f). Min: %d %f Max: %d %f", \ - CLS_MODULE_NAME, client, cvarName, fCvarVal, clsetting.CLSE_hasMin, \ - clsetting.CLSE_min, clsetting.CLSE_hasMax, clsetting.CLSE_max); - } - } - } + CLSEntry clsetting; + ClientSettingsArray.GetArray(clsetting_index, clsetting, sizeof(clsetting)); + + if ((clsetting.CLSE_hasMin && fCvarVal < clsetting.CLSE_min) + || (clsetting.CLSE_hasMax && fCvarVal > clsetting.CLSE_max) + ) { + switch (clsetting.CLSE_action) { + case CLSA_Kick: { + LogMessage("[%s] Kicking %L for bad %s value (%f). Min: %d %f Max: %d %f", \ + CLS_MODULE_NAME, client, cvarName, fCvarVal, clsetting.CLSE_hasMin, \ + clsetting.CLSE_min, clsetting.CLSE_hasMax, clsetting.CLSE_max); + + /*PrintToChatAll("\x01[\x05Confogl\x01] Kicking \x04%L\x01 for having an illegal value for '\x04%s\x01' (\x04%f\x01) !!!", \ + client, cvarName, fCvarVal);*/ + CPrintToChatAll("{blue}[{default}Confogl{blue}] {olive}%L{default} was kicked for having an illegal value for '{green}%s{default}' {blue}({default}%f{blue})", \ + client, cvarName, fCvarVal); + + char kickMessage[256] = "Illegal Client Value for "; + Format(kickMessage, sizeof(kickMessage), "%s%s (%.2f)", kickMessage, cvarName, fCvarVal); + + if (clsetting.CLSE_hasMin) { + Format(kickMessage, sizeof(kickMessage), "%s, Min %.2f", kickMessage, clsetting.CLSE_min); + } + + if (clsetting.CLSE_hasMax) { + Format(kickMessage, sizeof(kickMessage), "%s, Max %.2f", kickMessage, clsetting.CLSE_max); + } + + KickClient(client, "%s", kickMessage); + } + case CLSA_Log: { + LogMessage("[%s] Client %L has a bad %s value (%f). Min: %d %f Max: %d %f", \ + CLS_MODULE_NAME, client, cvarName, fCvarVal, clsetting.CLSE_hasMin, \ + clsetting.CLSE_min, clsetting.CLSE_hasMax, clsetting.CLSE_max); + } + } + } #else - CLSEntry clsetting[CLSEntry]; - ClientSettingsArray.GetArray(clsetting_index, clsetting[0], sizeof(clsetting)); - - if ((clsetting[CLSE_hasMin] && fCvarVal < clsetting[CLSE_min]) - || (clsetting[CLSE_hasMax] && fCvarVal > clsetting[CLSE_max]) - ) { - switch (clsetting[CLSE_action]) { - case CLSA_Kick: { - LogMessage("[%s] Kicking %L for bad %s value (%f). Min: %d %f Max: %d %f", \ - CLS_MODULE_NAME, client, cvarName, fCvarVal, clsetting[CLSE_hasMin], \ - clsetting[CLSE_min], clsetting[CLSE_hasMax], clsetting[CLSE_max]); - - /*PrintToChatAll("\x01[\x05Confogl\x01] Kicking \x04%L\x01 for having an illegal value for '\x04%s\x01' (\x04%f\x01) !!!", \ - client, cvarName, fCvarVal);*/ - CPrintToChatAll("{blue}[{default}Confogl{blue}] {olive}%L{default} was kicked for having an illegal value for '{green}%s{default}' {blue}({default}%f{blue})", \ - client, cvarName, fCvarVal); - - char kickMessage[256] = "Illegal Client Value for "; - Format(kickMessage, sizeof(kickMessage), "%s%s (%.2f)", kickMessage, cvarName, fCvarVal); - - if (clsetting[CLSE_hasMin]) { - Format(kickMessage, sizeof(kickMessage), "%s, Min %.2f", kickMessage, clsetting[CLSE_min]); - } - - if (clsetting[CLSE_hasMax]) { - Format(kickMessage, sizeof(kickMessage), "%s, Max %.2f", kickMessage, clsetting[CLSE_max]); - } - - KickClient(client, "%s", kickMessage); - } - case CLSA_Log: { - LogMessage("[%s] Client %L has a bad %s value (%f). Min: %d %f Max: %d %f", \ - CLS_MODULE_NAME, client, cvarName, fCvarVal, clsetting[CLSE_hasMin], \ - clsetting[CLSE_min], clsetting[CLSE_hasMax], clsetting[CLSE_max]); - } - } - } + CLSEntry clsetting[CLSEntry]; + ClientSettingsArray.GetArray(clsetting_index, clsetting[0], sizeof(clsetting)); + + if ((clsetting[CLSE_hasMin] && fCvarVal < clsetting[CLSE_min]) + || (clsetting[CLSE_hasMax] && fCvarVal > clsetting[CLSE_max]) + ) { + switch (clsetting[CLSE_action]) { + case CLSA_Kick: { + LogMessage("[%s] Kicking %L for bad %s value (%f). Min: %d %f Max: %d %f", \ + CLS_MODULE_NAME, client, cvarName, fCvarVal, clsetting[CLSE_hasMin], \ + clsetting[CLSE_min], clsetting[CLSE_hasMax], clsetting[CLSE_max]); + + /*PrintToChatAll("\x01[\x05Confogl\x01] Kicking \x04%L\x01 for having an illegal value for '\x04%s\x01' (\x04%f\x01) !!!", \ + client, cvarName, fCvarVal);*/ + CPrintToChatAll("{blue}[{default}Confogl{blue}] {olive}%L{default} was kicked for having an illegal value for '{green}%s{default}' {blue}({default}%f{blue})", \ + client, cvarName, fCvarVal); + + char kickMessage[256] = "Illegal Client Value for "; + Format(kickMessage, sizeof(kickMessage), "%s%s (%.2f)", kickMessage, cvarName, fCvarVal); + + if (clsetting[CLSE_hasMin]) { + Format(kickMessage, sizeof(kickMessage), "%s, Min %.2f", kickMessage, clsetting[CLSE_min]); + } + + if (clsetting[CLSE_hasMax]) { + Format(kickMessage, sizeof(kickMessage), "%s, Max %.2f", kickMessage, clsetting[CLSE_max]); + } + + KickClient(client, "%s", kickMessage); + } + case CLSA_Log: { + LogMessage("[%s] Client %L has a bad %s value (%f). Min: %d %f Max: %d %f", \ + CLS_MODULE_NAME, client, cvarName, fCvarVal, clsetting[CLSE_hasMin], \ + clsetting[CLSE_min], clsetting[CLSE_hasMax], clsetting[CLSE_max]); + } + } + } #endif } public Action _ClientSettings_Cmd(int client, int args) { - int iSize = ClientSettingsArray.Length; - ReplyToCommand(client, "[Confogl] Tracked Client CVars (Total %d)", iSize); + int iSize = ClientSettingsArray.Length; + ReplyToCommand(client, "[Confogl] Tracked Client CVars (Total %d)", iSize); #if SOURCEMOD_V_MINOR > 9 - CLSEntry clsetting; + CLSEntry clsetting; #else - CLSEntry clsetting[CLSEntry]; + CLSEntry clsetting[CLSEntry]; #endif - char message[256], shortbuf[64]; - for (int i = 0; i < iSize; i++) { - #if SOURCEMOD_V_MINOR > 9 - ClientSettingsArray.GetArray(i, clsetting, sizeof(clsetting)); - Format(message, sizeof(message), "[Confogl] Client CVar: %s ", clsetting.CLSE_cvar); - - if (clsetting.CLSE_hasMin) { - Format(shortbuf, sizeof(shortbuf), "Min: %f ", clsetting.CLSE_min); - StrCat(message, sizeof(message), shortbuf); - } - - if (clsetting.CLSE_hasMax) { - Format(shortbuf, sizeof(shortbuf), "Max: %f ", clsetting.CLSE_max); - StrCat(message, sizeof(message), shortbuf); - } - - switch (clsetting.CLSE_action) { - case CLSA_Kick: { - StrCat(message, sizeof(message), "Action: Kick"); - } - case CLSA_Log: { - StrCat(message, sizeof(message), "Action: Log"); - } - } - #else - ClientSettingsArray.GetArray(i, clsetting[0], sizeof(clsetting)); - Format(message, sizeof(message), "[Confogl] Client CVar: %s ", clsetting[CLSE_cvar]); - - if (clsetting[CLSE_hasMin]) { - Format(shortbuf, sizeof(shortbuf), "Min: %f ", clsetting[CLSE_min]); - StrCat(message, sizeof(message), shortbuf); - } - - if (clsetting[CLSE_hasMax]) { - Format(shortbuf, sizeof(shortbuf), "Max: %f ", clsetting[CLSE_max]); - StrCat(message, sizeof(message), shortbuf); - } - - switch (clsetting[CLSE_action]) { - case CLSA_Kick: { - StrCat(message, sizeof(message), "Action: Kick"); - } - case CLSA_Log: { - StrCat(message, sizeof(message), "Action: Log"); - } - } - #endif - - ReplyToCommand(client, message); - } - - return Plugin_Handled; + char message[256], shortbuf[64]; + for (int i = 0; i < iSize; i++) { + #if SOURCEMOD_V_MINOR > 9 + ClientSettingsArray.GetArray(i, clsetting, sizeof(clsetting)); + Format(message, sizeof(message), "[Confogl] Client CVar: %s ", clsetting.CLSE_cvar); + + if (clsetting.CLSE_hasMin) { + Format(shortbuf, sizeof(shortbuf), "Min: %f ", clsetting.CLSE_min); + StrCat(message, sizeof(message), shortbuf); + } + + if (clsetting.CLSE_hasMax) { + Format(shortbuf, sizeof(shortbuf), "Max: %f ", clsetting.CLSE_max); + StrCat(message, sizeof(message), shortbuf); + } + + switch (clsetting.CLSE_action) { + case CLSA_Kick: { + StrCat(message, sizeof(message), "Action: Kick"); + } + case CLSA_Log: { + StrCat(message, sizeof(message), "Action: Log"); + } + } + #else + ClientSettingsArray.GetArray(i, clsetting[0], sizeof(clsetting)); + Format(message, sizeof(message), "[Confogl] Client CVar: %s ", clsetting[CLSE_cvar]); + + if (clsetting[CLSE_hasMin]) { + Format(shortbuf, sizeof(shortbuf), "Min: %f ", clsetting[CLSE_min]); + StrCat(message, sizeof(message), shortbuf); + } + + if (clsetting[CLSE_hasMax]) { + Format(shortbuf, sizeof(shortbuf), "Max: %f ", clsetting[CLSE_max]); + StrCat(message, sizeof(message), shortbuf); + } + + switch (clsetting[CLSE_action]) { + case CLSA_Kick: { + StrCat(message, sizeof(message), "Action: Kick"); + } + case CLSA_Log: { + StrCat(message, sizeof(message), "Action: Log"); + } + } + #endif + + ReplyToCommand(client, message); + } + + return Plugin_Handled; } public Action _TrackClientCvar_Cmd(int args) { - if (args < 3 || args == 4) { - PrintToServer("Usage: confogl_trackclientcvar [ []]"); + if (args < 3 || args == 4) { + PrintToServer("Usage: confogl_trackclientcvar [ []]"); - if (IsDebugEnabled()) { - char cmdbuf[128]; - GetCmdArgString(cmdbuf, sizeof(cmdbuf)); - Debug_LogError(CLS_MODULE_NAME, "Invalid track client cvar: %s", cmdbuf); - } + if (IsDebugEnabled()) { + char cmdbuf[128]; + GetCmdArgString(cmdbuf, sizeof(cmdbuf)); + Debug_LogError(CLS_MODULE_NAME, "Invalid track client cvar: %s", cmdbuf); + } - return Plugin_Handled; - } + return Plugin_Handled; + } - char sBuffer[CLS_CVAR_MAXLEN], cvar[CLS_CVAR_MAXLEN]; - bool hasMax; - float max; - int action = CLSA_Kick; + char sBuffer[CLS_CVAR_MAXLEN], cvar[CLS_CVAR_MAXLEN]; + bool hasMax; + float max; + int action = CLSA_Kick; - GetCmdArg(1, cvar, sizeof(cvar)); + GetCmdArg(1, cvar, sizeof(cvar)); - if (!strlen(cvar)) { - PrintToServer("Unreadable cvar"); + if (!strlen(cvar)) { + PrintToServer("Unreadable cvar"); - if (IsDebugEnabled()) { - char cmdbuf[128]; - GetCmdArgString(cmdbuf, sizeof(cmdbuf)); - Debug_LogError(CLS_MODULE_NAME, "Invalid track client cvar: %s", cmdbuf); - } + if (IsDebugEnabled()) { + char cmdbuf[128]; + GetCmdArgString(cmdbuf, sizeof(cmdbuf)); + Debug_LogError(CLS_MODULE_NAME, "Invalid track client cvar: %s", cmdbuf); + } - return Plugin_Handled; - } + return Plugin_Handled; + } - GetCmdArg(2, sBuffer, sizeof(sBuffer)); - bool hasMin = view_as(StringToInt(sBuffer)); + GetCmdArg(2, sBuffer, sizeof(sBuffer)); + bool hasMin = view_as(StringToInt(sBuffer)); - GetCmdArg(3, sBuffer, sizeof(sBuffer)); - float min = StringToFloat(sBuffer); + GetCmdArg(3, sBuffer, sizeof(sBuffer)); + float min = StringToFloat(sBuffer); - if (args >= 5) { - GetCmdArg(4, sBuffer, sizeof(sBuffer)); - hasMax = view_as(StringToInt(sBuffer)); + if (args >= 5) { + GetCmdArg(4, sBuffer, sizeof(sBuffer)); + hasMax = view_as(StringToInt(sBuffer)); - GetCmdArg(5, sBuffer, sizeof(sBuffer)); - max = StringToFloat(sBuffer); - } + GetCmdArg(5, sBuffer, sizeof(sBuffer)); + max = StringToFloat(sBuffer); + } - if (args >= 6) { - GetCmdArg(6, sBuffer, sizeof(sBuffer)); - action = StringToInt(sBuffer); - } + if (args >= 6) { + GetCmdArg(6, sBuffer, sizeof(sBuffer)); + action = StringToInt(sBuffer); + } - _AddClientCvar(cvar, hasMin, min, hasMax, max, action); + _AddClientCvar(cvar, hasMin, min, hasMax, max, action); - return Plugin_Handled; + return Plugin_Handled; } public Action _ResetTracking_Cmd(int args) { - if (ClientSettingsCheckTimer != null) { - PrintToServer("Can't reset tracking in the middle of a match"); - return Plugin_Handled; - } + if (ClientSettingsCheckTimer != null) { + PrintToServer("Can't reset tracking in the middle of a match"); + return Plugin_Handled; + } - ClearAllSettings(); - PrintToServer("Client CVar Tracking Information Reset!"); + ClearAllSettings(); + PrintToServer("Client CVar Tracking Information Reset!"); - return Plugin_Handled; + return Plugin_Handled; } public Action _StartClientChecking_Cmd(int args) { - _StartTracking(); + _StartTracking(); - return Plugin_Handled; + return Plugin_Handled; } static void _StartTracking() { - if (IsPluginEnabled() && ClientSettingsCheckTimer == null) { - if (IsDebugEnabled()) { - LogMessage("[%s] Starting repeating check timer", CLS_MODULE_NAME); - } - - ClientSettingsCheckTimer = CreateTimer(CLIENT_CHECK_INTERVAL, _CheckClientSettings_Timer, _, TIMER_REPEAT); - } else { - PrintToServer("Can't start plugin tracking or tracking already started"); - } + if (IsPluginEnabled() && ClientSettingsCheckTimer == null) { + if (IsDebugEnabled()) { + LogMessage("[%s] Starting repeating check timer", CLS_MODULE_NAME); + } + + ClientSettingsCheckTimer = CreateTimer(CLIENT_CHECK_INTERVAL, _CheckClientSettings_Timer, _, TIMER_REPEAT); + } else { + PrintToServer("Can't start plugin tracking or tracking already started"); + } } static void _AddClientCvar(const char[] cvar, bool hasMin, float min, bool hasMax, float max, int action) { - if (ClientSettingsCheckTimer != null) { - PrintToServer("Can't track new cvars in the middle of a match"); + if (ClientSettingsCheckTimer != null) { + PrintToServer("Can't track new cvars in the middle of a match"); - if (IsDebugEnabled()) { - LogMessage("[%s] Attempt to track new cvar %s during a match!", CLS_MODULE_NAME, cvar); - } + if (IsDebugEnabled()) { + LogMessage("[%s] Attempt to track new cvar %s during a match!", CLS_MODULE_NAME, cvar); + } - return; - } + return; + } - if (!(hasMin || hasMax)) { - Debug_LogError(CLS_MODULE_NAME, "Client CVar %s specified without max or min", cvar); - return; - } + if (!(hasMin || hasMax)) { + Debug_LogError(CLS_MODULE_NAME, "Client CVar %s specified without max or min", cvar); + return; + } - if (hasMin && hasMax && max < min) { - Debug_LogError(CLS_MODULE_NAME, "Client CVar %s specified max < min (%f < %f)", cvar, max, min); - return; - } + if (hasMin && hasMax && max < min) { + Debug_LogError(CLS_MODULE_NAME, "Client CVar %s specified max < min (%f < %f)", cvar, max, min); + return; + } - if (strlen(cvar) >= CLS_CVAR_MAXLEN) { - Debug_LogError(CLS_MODULE_NAME, "CVar Specified (%s) is longer than max cvar length (%d)", cvar, CLS_CVAR_MAXLEN); - return; - } + if (strlen(cvar) >= CLS_CVAR_MAXLEN) { + Debug_LogError(CLS_MODULE_NAME, "CVar Specified (%s) is longer than max cvar length (%d)", cvar, CLS_CVAR_MAXLEN); + return; + } - int iSize = ClientSettingsArray.Length; + int iSize = ClientSettingsArray.Length; #if SOURCEMOD_V_MINOR > 9 - CLSEntry newEntry; - for (int i = 0; i < iSize; i++) { - ClientSettingsArray.GetArray(i, newEntry, sizeof(newEntry)); - if (strcmp(newEntry.CLSE_cvar, cvar, false) == 0) { - Debug_LogError(CLS_MODULE_NAME, "Attempt to track CVar %s, which is already being tracked.", cvar); - return; - } - } - - newEntry.CLSE_hasMin = hasMin; - newEntry.CLSE_min = min; - newEntry.CLSE_hasMax = hasMax; - newEntry.CLSE_max = max; - newEntry.CLSE_action = action; - strcopy(newEntry.CLSE_cvar, CLS_CVAR_MAXLEN, cvar); - - if (IsDebugEnabled()) { - LogMessage("[%s] Tracking Cvar %s Min %d %f Max %d %f Action %d", CLS_MODULE_NAME, cvar, hasMin, min, hasMax, max, action); - } - - ClientSettingsArray.PushArray(newEntry, sizeof(newEntry)); + CLSEntry newEntry; + for (int i = 0; i < iSize; i++) { + ClientSettingsArray.GetArray(i, newEntry, sizeof(newEntry)); + if (strcmp(newEntry.CLSE_cvar, cvar, false) == 0) { + Debug_LogError(CLS_MODULE_NAME, "Attempt to track CVar %s, which is already being tracked.", cvar); + return; + } + } + + newEntry.CLSE_hasMin = hasMin; + newEntry.CLSE_min = min; + newEntry.CLSE_hasMax = hasMax; + newEntry.CLSE_max = max; + newEntry.CLSE_action = action; + strcopy(newEntry.CLSE_cvar, CLS_CVAR_MAXLEN, cvar); + + if (IsDebugEnabled()) { + LogMessage("[%s] Tracking Cvar %s Min %d %f Max %d %f Action %d", CLS_MODULE_NAME, cvar, hasMin, min, hasMax, max, action); + } + + ClientSettingsArray.PushArray(newEntry, sizeof(newEntry)); #else - CLSEntry newEntry[CLSEntry]; - for (int i = 0; i < iSize; i++) { - ClientSettingsArray.GetArray(i, newEntry[0], sizeof(newEntry)); - if (strcmp(newEntry[CLSE_cvar], cvar, false) == 0) { - Debug_LogError(CLS_MODULE_NAME, "Attempt to track CVar %s, which is already being tracked.", cvar); - return; - } - } - - newEntry[CLSE_hasMin] = hasMin; - newEntry[CLSE_min] = min; - newEntry[CLSE_hasMax] = hasMax; - newEntry[CLSE_max] = max; - newEntry[CLSE_action] = action; - strcopy(newEntry[CLSE_cvar], CLS_CVAR_MAXLEN, cvar); - - if (IsDebugEnabled()) { - LogMessage("[%s] Tracking Cvar %s Min %d %f Max %d %f Action %d", CLS_MODULE_NAME, cvar, hasMin, min, hasMax, max, action); - } - - ClientSettingsArray.PushArray(newEntry[0], sizeof(newEntry)); + CLSEntry newEntry[CLSEntry]; + for (int i = 0; i < iSize; i++) { + ClientSettingsArray.GetArray(i, newEntry[0], sizeof(newEntry)); + if (strcmp(newEntry[CLSE_cvar], cvar, false) == 0) { + Debug_LogError(CLS_MODULE_NAME, "Attempt to track CVar %s, which is already being tracked.", cvar); + return; + } + } + + newEntry[CLSE_hasMin] = hasMin; + newEntry[CLSE_min] = min; + newEntry[CLSE_hasMax] = hasMax; + newEntry[CLSE_max] = max; + newEntry[CLSE_action] = action; + strcopy(newEntry[CLSE_cvar], CLS_CVAR_MAXLEN, cvar); + + if (IsDebugEnabled()) { + LogMessage("[%s] Tracking Cvar %s Min %d %f Max %d %f Action %d", CLS_MODULE_NAME, cvar, hasMin, min, hasMax, max, action); + } + + ClientSettingsArray.PushArray(newEntry[0], sizeof(newEntry)); #endif } diff --git a/addons/sourcemod/scripting/confoglcompmod/CvarSettings.sp b/addons/sourcemod/scripting/confoglcompmod/CvarSettings.sp index 55395df47..da1ed77bb 100644 --- a/addons/sourcemod/scripting/confoglcompmod/CvarSettings.sp +++ b/addons/sourcemod/scripting/confoglcompmod/CvarSettings.sp @@ -1,402 +1,402 @@ #if defined __cvar_settings_included - #endinput + #endinput #endif #define __cvar_settings_included -#define CVS_MODULE_NAME "CvarSettings" +#define CVS_MODULE_NAME "CvarSettings" -#define CVARS_DEBUG 0 -#define CVS_CVAR_MAXLEN 64 +#define CVARS_DEBUG 0 +#define CVS_CVAR_MAXLEN 64 #if SOURCEMOD_V_MINOR > 9 enum struct CVSEntry { - ConVar CVSE_cvar; - char CVSE_oldval[CVS_CVAR_MAXLEN]; - char CVSE_newval[CVS_CVAR_MAXLEN]; + ConVar CVSE_cvar; + char CVSE_oldval[CVS_CVAR_MAXLEN]; + char CVSE_newval[CVS_CVAR_MAXLEN]; } #else enum CVSEntry { - ConVar:CVSE_cvar, - String:CVSE_oldval[CVS_CVAR_MAXLEN], - String:CVSE_newval[CVS_CVAR_MAXLEN] + ConVar:CVSE_cvar, + String:CVSE_oldval[CVS_CVAR_MAXLEN], + String:CVSE_newval[CVS_CVAR_MAXLEN] }; #endif static bool - bTrackingStarted = false; + bTrackingStarted = false; static ArrayList - CvarSettingsArray = null; + CvarSettingsArray = null; void CVS_OnModuleStart() { #if SOURCEMOD_V_MINOR > 9 - CVSEntry cvsetting; + CVSEntry cvsetting; #else - CVSEntry cvsetting[CVSEntry]; + CVSEntry cvsetting[CVSEntry]; #endif - CvarSettingsArray = new ArrayList(sizeof(cvsetting)); + CvarSettingsArray = new ArrayList(sizeof(cvsetting)); - RegConsoleCmd("confogl_cvarsettings", CVS_CvarSettings_Cmd, "List all ConVars being enforced by Confogl"); - RegConsoleCmd("confogl_cvardiff", CVS_CvarDiff_Cmd, "List any ConVars that have been changed from their initialized values"); + RegConsoleCmd("confogl_cvarsettings", CVS_CvarSettings_Cmd, "List all ConVars being enforced by Confogl"); + RegConsoleCmd("confogl_cvardiff", CVS_CvarDiff_Cmd, "List any ConVars that have been changed from their initialized values"); - RegServerCmd("confogl_addcvar", CVS_AddCvar_Cmd, "Add a ConVar to be set by Confogl"); - RegServerCmd("confogl_setcvars", CVS_SetCvars_Cmd, "Starts enforcing ConVars that have been added."); - RegServerCmd("confogl_resetcvars", CVS_ResetCvars_Cmd, "Resets enforced ConVars. Cannot be used during a match!"); + RegServerCmd("confogl_addcvar", CVS_AddCvar_Cmd, "Add a ConVar to be set by Confogl"); + RegServerCmd("confogl_setcvars", CVS_SetCvars_Cmd, "Starts enforcing ConVars that have been added."); + RegServerCmd("confogl_resetcvars", CVS_ResetCvars_Cmd, "Resets enforced ConVars. Cannot be used during a match!"); } void CVS_OnModuleEnd() { - ClearAllSettings(); + ClearAllCvars(); } void CVS_OnConfigsExecuted() { - if (bTrackingStarted) { - SetEnforcedCvars(); - } + if (bTrackingStarted) { + SetEnforcedCvars(); + } } public Action CVS_SetCvars_Cmd(int args) { - if (!IsPluginEnabled()) { - return Plugin_Handled; - } + if (!IsPluginEnabled()) { + return Plugin_Handled; + } - if (bTrackingStarted) { - PrintToServer("Tracking has already been started"); - return Plugin_Handled; - } + if (bTrackingStarted) { + PrintToServer("Tracking has already been started"); + return Plugin_Handled; + } #if CVARS_DEBUG - LogMessage("[%s] No longer accepting new ConVars", CVS_MODULE_NAME); + LogMessage("[%s] No longer accepting new ConVars", CVS_MODULE_NAME); #endif - SetEnforcedCvars(); - bTrackingStarted = true; + SetEnforcedCvars(); + bTrackingStarted = true; - return Plugin_Handled; + return Plugin_Handled; } public Action CVS_AddCvar_Cmd(int args) { - if (args != 2) { - PrintToServer("Usage: confogl_addcvar "); + if (args != 2) { + PrintToServer("Usage: confogl_addcvar "); - if (IsDebugEnabled()) { - char cmdbuf[MAX_NAME_LENGTH]; - GetCmdArgString(cmdbuf, sizeof(cmdbuf)); - Debug_LogError(CVS_MODULE_NAME, "Invalid Cvar Add: %s", cmdbuf); - } + if (IsDebugEnabled()) { + char cmdbuf[MAX_NAME_LENGTH]; + GetCmdArgString(cmdbuf, sizeof(cmdbuf)); + Debug_LogError(CVS_MODULE_NAME, "Invalid Cvar Add: %s", cmdbuf); + } - return Plugin_Handled; - } + return Plugin_Handled; + } - char cvar[CVS_CVAR_MAXLEN], newval[CVS_CVAR_MAXLEN]; - GetCmdArg(1, cvar, sizeof(cvar)); - GetCmdArg(2, newval, sizeof(newval)); + char cvar[CVS_CVAR_MAXLEN], newval[CVS_CVAR_MAXLEN]; + GetCmdArg(1, cvar, sizeof(cvar)); + GetCmdArg(2, newval, sizeof(newval)); - AddCvar(cvar, newval); + AddCvar(cvar, newval); - return Plugin_Handled; + return Plugin_Handled; } public Action CVS_ResetCvars_Cmd(int args) { - if (IsPluginEnabled()) { - PrintToServer("Can't reset tracking in the middle of a match"); - return Plugin_Handled; - } + if (IsPluginEnabled()) { + PrintToServer("Can't reset tracking in the middle of a match"); + return Plugin_Handled; + } - ClearAllSettings(); - PrintToServer("Server CVar Tracking Information Reset!"); + ClearAllCvars(); + PrintToServer("Server CVar Tracking Information Reset!"); - return Plugin_Handled; + return Plugin_Handled; } public Action CVS_CvarSettings_Cmd(int client, int args) { - if (!IsPluginEnabled()) { - return Plugin_Handled; - } + if (!IsPluginEnabled()) { + return Plugin_Handled; + } - if (!bTrackingStarted) { - ReplyToCommand(client, "[Confogl] CVar tracking has not been started!! THIS SHOULD NOT OCCUR DURING A MATCH!"); - return Plugin_Handled; - } + if (!bTrackingStarted) { + ReplyToCommand(client, "[Confogl] CVar tracking has not been started!! THIS SHOULD NOT OCCUR DURING A MATCH!"); + return Plugin_Handled; + } - char buffer[CVS_CVAR_MAXLEN], name[CVS_CVAR_MAXLEN]; - int cvscount = CvarSettingsArray.Length; + char buffer[CVS_CVAR_MAXLEN], name[CVS_CVAR_MAXLEN]; + int cvscount = CvarSettingsArray.Length; - ReplyToCommand(client, "[Confogl] Enforced Server CVars (Total %d)", cvscount); + ReplyToCommand(client, "[Confogl] Enforced Server CVars (Total %d)", cvscount); - GetCmdArg(1, buffer, sizeof(buffer)); - int offset = StringToInt(buffer); + GetCmdArg(1, buffer, sizeof(buffer)); + int offset = StringToInt(buffer); - if (offset < 0 || offset > cvscount) { - return Plugin_Handled; - } + if (offset < 0 || offset > cvscount) { + return Plugin_Handled; + } - int temp = cvscount; - if ((offset + 20) < cvscount) { - temp = offset + 20; - } + int temp = cvscount; + if ((offset + 20) < cvscount) { + temp = offset + 20; + } #if SOURCEMOD_V_MINOR > 9 - CVSEntry cvsetting; + CVSEntry cvsetting; - for (int i = offset; i < temp && i < cvscount; i++) { - CvarSettingsArray.GetArray(i, cvsetting, sizeof(cvsetting)); + for (int i = offset; i < temp && i < cvscount; i++) { + CvarSettingsArray.GetArray(i, cvsetting, sizeof(cvsetting)); - (cvsetting.CVSE_cvar).GetString(buffer, sizeof(buffer)); - (cvsetting.CVSE_cvar).GetName(name, sizeof(name)); + (cvsetting.CVSE_cvar).GetString(buffer, sizeof(buffer)); + (cvsetting.CVSE_cvar).GetName(name, sizeof(name)); - ReplyToCommand(client, "[Confogl] Server CVar: %s, Desired Value: %s, Current Value: %s", name, cvsetting.CVSE_newval, buffer); - } + ReplyToCommand(client, "[Confogl] Server CVar: %s, Desired Value: %s, Current Value: %s", name, cvsetting.CVSE_newval, buffer); + } #else - CVSEntry cvsetting[CVSEntry]; + CVSEntry cvsetting[CVSEntry]; - for (int i = offset; i < temp && i < cvscount; i++) { - CvarSettingsArray.GetArray(i, cvsetting[0], sizeof(cvsetting)); + for (int i = offset; i < temp && i < cvscount; i++) { + CvarSettingsArray.GetArray(i, cvsetting[0], sizeof(cvsetting)); - cvsetting[CVSE_cvar].GetString(buffer, sizeof(buffer)); - cvsetting[CVSE_cvar].GetName(name, sizeof(name)); + cvsetting[CVSE_cvar].GetString(buffer, sizeof(buffer)); + cvsetting[CVSE_cvar].GetName(name, sizeof(name)); - ReplyToCommand(client, "[Confogl] Server CVar: %s, Desired Value: %s, Current Value: %s", name, cvsetting[CVSE_newval], buffer); - } + ReplyToCommand(client, "[Confogl] Server CVar: %s, Desired Value: %s, Current Value: %s", name, cvsetting[CVSE_newval], buffer); + } #endif - if ((offset + 20) < cvscount) { - ReplyToCommand(client, "[Confogl] To see more CVars, use confogl_cvarsettings %d", offset + 20); - } + if ((offset + 20) < cvscount) { + ReplyToCommand(client, "[Confogl] To see more CVars, use confogl_cvarsettings %d", offset + 20); + } - return Plugin_Handled; + return Plugin_Handled; } public Action CVS_CvarDiff_Cmd(int client, int args) { - if (!IsPluginEnabled()) { - return Plugin_Handled; - } + if (!IsPluginEnabled()) { + return Plugin_Handled; + } - if (!bTrackingStarted) { - ReplyToCommand(client, "[Confogl] CVar tracking has not been started!! THIS SHOULD NOT OCCUR DURING A MATCH!"); - return Plugin_Handled; - } + if (!bTrackingStarted) { + ReplyToCommand(client, "[Confogl] CVar tracking has not been started!! THIS SHOULD NOT OCCUR DURING A MATCH!"); + return Plugin_Handled; + } - char buffer[CVS_CVAR_MAXLEN], name[CVS_CVAR_MAXLEN]; - int cvscount = CvarSettingsArray.Length; + char buffer[CVS_CVAR_MAXLEN], name[CVS_CVAR_MAXLEN]; + int cvscount = CvarSettingsArray.Length; - GetCmdArg(1, buffer, sizeof(buffer)); - int offset = StringToInt(buffer); + GetCmdArg(1, buffer, sizeof(buffer)); + int offset = StringToInt(buffer); - if (offset > cvscount) { - return Plugin_Handled; - } + if (offset > cvscount) { + return Plugin_Handled; + } - int foundCvars = 0; + int foundCvars = 0; #if SOURCEMOD_V_MINOR > 9 - CVSEntry cvsetting; + CVSEntry cvsetting; - while (offset < cvscount && foundCvars < 20) { - CvarSettingsArray.GetArray(offset, cvsetting, sizeof(cvsetting)); + while (offset < cvscount && foundCvars < 20) { + CvarSettingsArray.GetArray(offset, cvsetting, sizeof(cvsetting)); - (cvsetting.CVSE_cvar).GetString(buffer, sizeof(buffer)); - (cvsetting.CVSE_cvar).GetName(name, sizeof(name)); + (cvsetting.CVSE_cvar).GetString(buffer, sizeof(buffer)); + (cvsetting.CVSE_cvar).GetName(name, sizeof(name)); - if (strcmp(cvsetting.CVSE_newval, buffer) != 0) { - ReplyToCommand(client, "[Confogl] Server CVar: %s, Desired Value: %s, Current Value: %s", name, cvsetting.CVSE_newval, buffer); - foundCvars++; - } + if (strcmp(cvsetting.CVSE_newval, buffer) != 0) { + ReplyToCommand(client, "[Confogl] Server CVar: %s, Desired Value: %s, Current Value: %s", name, cvsetting.CVSE_newval, buffer); + foundCvars++; + } - offset++; - } + offset++; + } #else - CVSEntry cvsetting[CVSEntry]; + CVSEntry cvsetting[CVSEntry]; - while (offset < cvscount && foundCvars < 20) { - CvarSettingsArray.GetArray(offset, cvsetting[0], sizeof(cvsetting)); + while (offset < cvscount && foundCvars < 20) { + CvarSettingsArray.GetArray(offset, cvsetting[0], sizeof(cvsetting)); - cvsetting[CVSE_cvar].GetString(buffer, sizeof(buffer)); - cvsetting[CVSE_cvar].GetName(name, sizeof(name)); + cvsetting[CVSE_cvar].GetString(buffer, sizeof(buffer)); + cvsetting[CVSE_cvar].GetName(name, sizeof(name)); - if (strcmp(cvsetting[CVSE_newval], buffer) != 0) { - ReplyToCommand(client, "[Confogl] Server CVar: %s, Desired Value: %s, Current Value: %s", name, cvsetting[CVSE_newval], buffer); - foundCvars++; - } + if (strcmp(cvsetting[CVSE_newval], buffer) != 0) { + ReplyToCommand(client, "[Confogl] Server CVar: %s, Desired Value: %s, Current Value: %s", name, cvsetting[CVSE_newval], buffer); + foundCvars++; + } - offset++; - } + offset++; + } #endif - if (offset < cvscount) { - ReplyToCommand(client, "[Confogl] To see more CVars, use confogl_cvarsettings %d", offset); - } + if (offset < cvscount) { + ReplyToCommand(client, "[Confogl] To see more CVars, use confogl_cvarsettings %d", offset); + } - return Plugin_Handled; + return Plugin_Handled; } -static void ClearAllSettings() +void ClearAllCvars() { - bTrackingStarted = false; - int iSize = CvarSettingsArray.Length; + bTrackingStarted = false; + int iSize = CvarSettingsArray.Length; #if SOURCEMOD_V_MINOR > 9 - CVSEntry cvsetting; + CVSEntry cvsetting; - for (int i = 0; i < iSize; i++) { - CvarSettingsArray.GetArray(i, cvsetting, sizeof(cvsetting)); + for (int i = 0; i < iSize; i++) { + CvarSettingsArray.GetArray(i, cvsetting, sizeof(cvsetting)); - (cvsetting.CVSE_cvar).RemoveChangeHook(CVS_ConVarChange); - (cvsetting.CVSE_cvar).SetString(cvsetting.CVSE_oldval); - } + (cvsetting.CVSE_cvar).RemoveChangeHook(CVS_ConVarChange); + (cvsetting.CVSE_cvar).SetString(cvsetting.CVSE_oldval); + } #else - CVSEntry cvsetting[CVSEntry]; + CVSEntry cvsetting[CVSEntry]; - for (int i = 0; i < iSize; i++) { - CvarSettingsArray.GetArray(i, cvsetting[0], sizeof(cvsetting)); + for (int i = 0; i < iSize; i++) { + CvarSettingsArray.GetArray(i, cvsetting[0], sizeof(cvsetting)); - cvsetting[CVSE_cvar].RemoveChangeHook(CVS_ConVarChange); - cvsetting[CVSE_cvar].SetString(cvsetting[CVSE_oldval]); - } + cvsetting[CVSE_cvar].RemoveChangeHook(CVS_ConVarChange); + cvsetting[CVSE_cvar].SetString(cvsetting[CVSE_oldval]); + } #endif - CvarSettingsArray.Clear(); + CvarSettingsArray.Clear(); } static void SetEnforcedCvars() { - int iSize = CvarSettingsArray.Length; + int iSize = CvarSettingsArray.Length; #if SOURCEMOD_V_MINOR > 9 - CVSEntry cvsetting; + CVSEntry cvsetting; - for (int i = 0; i < iSize; i++) { - CvarSettingsArray.GetArray(i, cvsetting, sizeof(cvsetting)); + for (int i = 0; i < iSize; i++) { + CvarSettingsArray.GetArray(i, cvsetting, sizeof(cvsetting)); - #if CVARS_DEBUG - char debug_buffer[CVS_CVAR_MAXLEN]; - (cvsetting.CVSE_cvar).GetName(debug_buffer, sizeof(debug_buffer)); - LogMessage("[%s] cvar = %s, newval = %s", CVS_MODULE_NAME, debug_buffer, cvsetting.CVSE_newval); - #endif + #if CVARS_DEBUG + char debug_buffer[CVS_CVAR_MAXLEN]; + (cvsetting.CVSE_cvar).GetName(debug_buffer, sizeof(debug_buffer)); + LogMessage("[%s] cvar = %s, newval = %s", CVS_MODULE_NAME, debug_buffer, cvsetting.CVSE_newval); + #endif - (cvsetting.CVSE_cvar).SetString(cvsetting.CVSE_newval); - } + (cvsetting.CVSE_cvar).SetString(cvsetting.CVSE_newval); + } #else - CVSEntry cvsetting[CVSEntry]; + CVSEntry cvsetting[CVSEntry]; - for (int i = 0; i < iSize; i++) { - CvarSettingsArray.GetArray(i, cvsetting[0], sizeof(cvsetting)); + for (int i = 0; i < iSize; i++) { + CvarSettingsArray.GetArray(i, cvsetting[0], sizeof(cvsetting)); - #if CVARS_DEBUG - char debug_buffer[CVS_CVAR_MAXLEN]; - cvsetting[CVSE_cvar].GetName(debug_buffer, sizeof(debug_buffer)); - LogMessage("[%s] cvar = %s, newval = %s", CVS_MODULE_NAME, debug_buffer, cvsetting[CVSE_newval]); - #endif + #if CVARS_DEBUG + char debug_buffer[CVS_CVAR_MAXLEN]; + cvsetting[CVSE_cvar].GetName(debug_buffer, sizeof(debug_buffer)); + LogMessage("[%s] cvar = %s, newval = %s", CVS_MODULE_NAME, debug_buffer, cvsetting[CVSE_newval]); + #endif - cvsetting[CVSE_cvar].SetString(cvsetting[CVSE_newval]); - } + cvsetting[CVSE_cvar].SetString(cvsetting[CVSE_newval]); + } #endif } static void AddCvar(const char[] cvar, const char[] newval) { - if (bTrackingStarted) { - #if CVARS_DEBUG - LogMessage("[%s] Attempt to track new cvar %s during a match!", CVS_MODULE_NAME, cvar); - #endif - return; - } + if (bTrackingStarted) { + #if CVARS_DEBUG + LogMessage("[%s] Attempt to track new cvar %s during a match!", CVS_MODULE_NAME, cvar); + #endif + return; + } - if (strlen(cvar) >= CVS_CVAR_MAXLEN) { - Debug_LogError(CVS_MODULE_NAME, "CVar Specified (%s) is longer than max cvar/value length (%d)", cvar, CVS_CVAR_MAXLEN); - return; - } + if (strlen(cvar) >= CVS_CVAR_MAXLEN) { + Debug_LogError(CVS_MODULE_NAME, "CVar Specified (%s) is longer than max cvar/value length (%d)", cvar, CVS_CVAR_MAXLEN); + return; + } - if (strlen(newval) >= CVS_CVAR_MAXLEN) { - Debug_LogError(CVS_MODULE_NAME, "New Value Specified (%s) is longer than max cvar/value length (%d)", newval, CVS_CVAR_MAXLEN); - return; - } + if (strlen(newval) >= CVS_CVAR_MAXLEN) { + Debug_LogError(CVS_MODULE_NAME, "New Value Specified (%s) is longer than max cvar/value length (%d)", newval, CVS_CVAR_MAXLEN); + return; + } - ConVar newCvar = FindConVar(cvar); + ConVar newCvar = FindConVar(cvar); - if (newCvar == null) { - Debug_LogError(CVS_MODULE_NAME, "Could not find CVar specified (%s)", cvar); - return; - } + if (newCvar == null) { + Debug_LogError(CVS_MODULE_NAME, "Could not find CVar specified (%s)", cvar); + return; + } - char cvarBuffer[CVS_CVAR_MAXLEN]; - int iSize = CvarSettingsArray.Length; + char cvarBuffer[CVS_CVAR_MAXLEN]; + int iSize = CvarSettingsArray.Length; #if SOURCEMOD_V_MINOR > 9 - CVSEntry newEntry; + CVSEntry newEntry; - for (int i = 0; i < iSize; i++) { - CvarSettingsArray.GetArray(i, newEntry, sizeof(newEntry)); + for (int i = 0; i < iSize; i++) { + CvarSettingsArray.GetArray(i, newEntry, sizeof(newEntry)); - (newEntry.CVSE_cvar).GetName(cvarBuffer, CVS_CVAR_MAXLEN); + (newEntry.CVSE_cvar).GetName(cvarBuffer, CVS_CVAR_MAXLEN); - if (strcmp(cvar, cvarBuffer, false) == 0) { - Debug_LogError(CVS_MODULE_NAME, "Attempt to track ConVar %s, which is already being tracked.", cvar); - return; - } - } + if (strcmp(cvar, cvarBuffer, false) == 0) { + Debug_LogError(CVS_MODULE_NAME, "Attempt to track ConVar %s, which is already being tracked.", cvar); + return; + } + } - newCvar.GetString(cvarBuffer, CVS_CVAR_MAXLEN); + newCvar.GetString(cvarBuffer, CVS_CVAR_MAXLEN); - newEntry.CVSE_cvar = newCvar; - strcopy(newEntry.CVSE_oldval, CVS_CVAR_MAXLEN, cvarBuffer); - strcopy(newEntry.CVSE_newval, CVS_CVAR_MAXLEN, newval); + newEntry.CVSE_cvar = newCvar; + strcopy(newEntry.CVSE_oldval, CVS_CVAR_MAXLEN, cvarBuffer); + strcopy(newEntry.CVSE_newval, CVS_CVAR_MAXLEN, newval); - newCvar.AddChangeHook(CVS_ConVarChange); + newCvar.AddChangeHook(CVS_ConVarChange); #if CVARS_DEBUG - LogMessage("[%s] cvar = %s, newval = %s, oldval = %s", CVS_MODULE_NAME, cvar, newval, cvarBuffer); + LogMessage("[%s] cvar = %s, newval = %s, oldval = %s", CVS_MODULE_NAME, cvar, newval, cvarBuffer); #endif - CvarSettingsArray.PushArray(newEntry, sizeof(newEntry)); + CvarSettingsArray.PushArray(newEntry, sizeof(newEntry)); #else - CVSEntry newEntry[CVSEntry]; + CVSEntry newEntry[CVSEntry]; - for (int i = 0; i < iSize; i++) { - CvarSettingsArray.GetArray(i, newEntry[0], sizeof(newEntry)); + for (int i = 0; i < iSize; i++) { + CvarSettingsArray.GetArray(i, newEntry[0], sizeof(newEntry)); - newEntry[CVSE_cvar].GetName(cvarBuffer, CVS_CVAR_MAXLEN); + newEntry[CVSE_cvar].GetName(cvarBuffer, CVS_CVAR_MAXLEN); - if (strcmp(cvar, cvarBuffer, false) == 0) { - Debug_LogError(CVS_MODULE_NAME, "Attempt to track ConVar %s, which is already being tracked.", cvar); - return; - } - } + if (strcmp(cvar, cvarBuffer, false) == 0) { + Debug_LogError(CVS_MODULE_NAME, "Attempt to track ConVar %s, which is already being tracked.", cvar); + return; + } + } - newCvar.GetString(cvarBuffer, CVS_CVAR_MAXLEN); + newCvar.GetString(cvarBuffer, CVS_CVAR_MAXLEN); - newEntry[CVSE_cvar] = newCvar; - strcopy(newEntry[CVSE_oldval], CVS_CVAR_MAXLEN, cvarBuffer); - strcopy(newEntry[CVSE_newval], CVS_CVAR_MAXLEN, newval); + newEntry[CVSE_cvar] = newCvar; + strcopy(newEntry[CVSE_oldval], CVS_CVAR_MAXLEN, cvarBuffer); + strcopy(newEntry[CVSE_newval], CVS_CVAR_MAXLEN, newval); - newCvar.AddChangeHook(CVS_ConVarChange); + newCvar.AddChangeHook(CVS_ConVarChange); #if CVARS_DEBUG - LogMessage("[%s] cvar = %s, newval = %s, oldval = %s", CVS_MODULE_NAME, cvar, newval, cvarBuffer); + LogMessage("[%s] cvar = %s, newval = %s, oldval = %s", CVS_MODULE_NAME, cvar, newval, cvarBuffer); #endif - CvarSettingsArray.PushArray(newEntry[0], sizeof(newEntry)); + CvarSettingsArray.PushArray(newEntry[0], sizeof(newEntry)); #endif } public void CVS_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - if (bTrackingStarted) { - char sName[CVS_CVAR_MAXLEN]; - hConVar.GetName(sName, sizeof(sName)); - - PrintToServer("[Confogl] Tracked Server CVar '%s' changed from '%s' to '%s' !!!", sName, sOldValue, sNewValue); - //PrintToChatAll("[Confogl] Tracked Server CVar '%s' changed from '%s' to '%s' !!!", sName, sOldValue, sNewValue); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Tracked Server CVar '{green}%s{default}' changed from '{blue}%s{default}' to '{blue}%s{default}' !!!", sName, sOldValue, sNewValue); - } + if (bTrackingStarted) { + char sName[CVS_CVAR_MAXLEN]; + hConVar.GetName(sName, sizeof(sName)); + + PrintToServer("[Confogl] Tracked Server CVar '%s' changed from '%s' to '%s' !!!", sName, sOldValue, sNewValue); + //PrintToChatAll("[Confogl] Tracked Server CVar '%s' changed from '%s' to '%s' !!!", sName, sOldValue, sNewValue); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Tracked Server CVar '{green}%s{default}' changed from '{blue}%s{default}' to '{blue}%s{default}' !!!", sName, sOldValue, sNewValue); + } } diff --git a/addons/sourcemod/scripting/confoglcompmod/EntityRemover.sp b/addons/sourcemod/scripting/confoglcompmod/EntityRemover.sp index 4f73d4d04..f43cb6f04 100644 --- a/addons/sourcemod/scripting/confoglcompmod/EntityRemover.sp +++ b/addons/sourcemod/scripting/confoglcompmod/EntityRemover.sp @@ -1,403 +1,403 @@ #if defined __entity_remover_included - #endinput + #endinput #endif #define __entity_remover_included -#define ER_MODULE_NAME "EntityRemover" +#define ER_MODULE_NAME "EntityRemover" -#define DEBUG_ER 0 +#define DEBUG_ER 0 -#define ER_KV_ACTION_KILL 1 +#define ER_KV_ACTION_KILL 1 -#define ER_KV_PROPTYPE_INT 1 -#define ER_KV_PROPTYPE_FLOAT 2 -#define ER_KV_PROPTYPE_BOOL 3 -#define ER_KV_PROPTYPE_STRING 4 +#define ER_KV_PROPTYPE_INT 1 +#define ER_KV_PROPTYPE_FLOAT 2 +#define ER_KV_PROPTYPE_BOOL 3 +#define ER_KV_PROPTYPE_STRING 4 -#define ER_KV_CONDITION_EQUAL 1 -#define ER_KV_CONDITION_NEQUAL 2 -#define ER_KV_CONDITION_LESS 3 -#define ER_KV_CONDITION_GREAT 4 -#define ER_KV_CONDITION_CONTAINS 5 +#define ER_KV_CONDITION_EQUAL 1 +#define ER_KV_CONDITION_NEQUAL 2 +#define ER_KV_CONDITION_LESS 3 +#define ER_KV_CONDITION_GREAT 4 +#define ER_KV_CONDITION_CONTAINS 5 static bool - ER_bKillParachutist = true, - ER_bReplaceGhostHurt = false; + ER_bKillParachutist = true, + ER_bReplaceGhostHurt = false; static ConVar - ER_hKillParachutist = null, - ER_hReplaceGhostHurt = null; + ER_hKillParachutist = null, + ER_hReplaceGhostHurt = null; static KeyValues - kERData = null; + kERData = null; void ER_OnModuleStart() { - ER_hKillParachutist = CreateConVarEx("remove_parachutist", "1", "Removes the parachutist from c3m2", _, true, 0.0, true, 1.0); - ER_hReplaceGhostHurt = CreateConVarEx( \ - "disable_ghost_hurt", \ - "0", \ - "Replaces all trigger_ghost_hurt with trigger_hurt, blocking ghost spawns from dying.", \ - _, true, 0.0, true, 1.0 \ - ); + ER_hKillParachutist = CreateConVarEx("remove_parachutist", "1", "Removes the parachutist from c3m2", _, true, 0.0, true, 1.0); + ER_hReplaceGhostHurt = CreateConVarEx( \ + "disable_ghost_hurt", \ + "0", \ + "Replaces all trigger_ghost_hurt with trigger_hurt, blocking ghost spawns from dying.", \ + _, true, 0.0, true, 1.0 \ + ); - ER_bKillParachutist = ER_hKillParachutist.BoolValue; - ER_bReplaceGhostHurt = ER_hReplaceGhostHurt.BoolValue; + ER_bKillParachutist = ER_hKillParachutist.BoolValue; + ER_bReplaceGhostHurt = ER_hReplaceGhostHurt.BoolValue; - ER_hKillParachutist.AddChangeHook(ER_ConVarChange); - ER_hReplaceGhostHurt.AddChangeHook(ER_ConVarChange); + ER_hKillParachutist.AddChangeHook(ER_ConVarChange); + ER_hReplaceGhostHurt.AddChangeHook(ER_ConVarChange); - ER_KV_Load(); + ER_KV_Load(); - RegAdminCmd("confogl_erdata_reload", ER_KV_CmdReload, ADMFLAG_CONFIG); + RegAdminCmd("confogl_erdata_reload", ER_KV_CmdReload, ADMFLAG_CONFIG); - HookEvent("round_start", ER_RoundStart_Event, EventHookMode_PostNoCopy); + HookEvent("round_start", ER_RoundStart_Event, EventHookMode_PostNoCopy); } public void ER_ConVarChange(ConVar hConvar, const char[] sOldValue, const char[] sNewValue) { - ER_bKillParachutist = ER_hKillParachutist.BoolValue; - ER_bReplaceGhostHurt = ER_hReplaceGhostHurt.BoolValue; + ER_bKillParachutist = ER_hKillParachutist.BoolValue; + ER_bReplaceGhostHurt = ER_hReplaceGhostHurt.BoolValue; } void ER_OnModuleEnd() { - ER_KV_Close(); + ER_KV_Close(); } static void ER_KV_Close() { - if (kERData != null) { - delete kERData; - kERData = null; - } + if (kERData != null) { + delete kERData; + kERData = null; + } } static void ER_KV_Load() { - char sNameBuff[PLATFORM_MAX_PATH], sDescBuff[256], sValBuff[32]; + char sNameBuff[PLATFORM_MAX_PATH], sDescBuff[256], sValBuff[32]; - if (DEBUG_ER || IsDebugEnabled()) { - LogMessage("[%s] Loading EntityRemover KeyValues", ER_MODULE_NAME); - } + if (DEBUG_ER || IsDebugEnabled()) { + LogMessage("[%s] Loading EntityRemover KeyValues", ER_MODULE_NAME); + } - kERData = new KeyValues("EntityRemover"); + kERData = new KeyValues("EntityRemover"); - BuildConfigPath(sNameBuff, sizeof(sNameBuff), "entityremove.txt"); //Build our filepath + BuildConfigPath(sNameBuff, sizeof(sNameBuff), "entityremove.txt"); //Build our filepath - if (!kERData.ImportFromFile(sNameBuff)) { - Debug_LogError(ER_MODULE_NAME, "Couldn't load EntityRemover data!"); - ER_KV_Close(); - return; - } + if (!kERData.ImportFromFile(sNameBuff)) { + Debug_LogError(ER_MODULE_NAME, "Couldn't load EntityRemover data!"); + ER_KV_Close(); + return; + } - // Create cvars for all entity removes - if (DEBUG_ER || IsDebugEnabled()) { - LogMessage("[%s] Creating entry CVARs", ER_MODULE_NAME); - } + // Create cvars for all entity removes + if (DEBUG_ER || IsDebugEnabled()) { + LogMessage("[%s] Creating entry CVARs", ER_MODULE_NAME); + } - kERData.GotoFirstSubKey(); + kERData.GotoFirstSubKey(); - do { - kERData.GotoFirstSubKey(); + do { + kERData.GotoFirstSubKey(); - do { - kERData.GetString("cvar", sNameBuff, sizeof(sNameBuff)); - kERData.GetString("cvar_desc", sDescBuff, sizeof(sDescBuff)); - kERData.GetString("cvar_val", sValBuff, sizeof(sValBuff)); + do { + kERData.GetString("cvar", sNameBuff, sizeof(sNameBuff)); + kERData.GetString("cvar_desc", sDescBuff, sizeof(sDescBuff)); + kERData.GetString("cvar_val", sValBuff, sizeof(sValBuff)); - CreateConVarEx(sNameBuff, sValBuff, sDescBuff); + CreateConVarEx(sNameBuff, sValBuff, sDescBuff); - if (DEBUG_ER || IsDebugEnabled()) { - LogMessage("[%s] Creating CVAR %s", ER_MODULE_NAME, sNameBuff); - } + if (DEBUG_ER || IsDebugEnabled()) { + LogMessage("[%s] Creating CVAR %s", ER_MODULE_NAME, sNameBuff); + } - } while(kERData.GotoNextKey()); + } while(kERData.GotoNextKey()); - kERData.GoBack(); - } while(kERData.GotoNextKey()); + kERData.GoBack(); + } while(kERData.GotoNextKey()); - kERData.Rewind(); + kERData.Rewind(); } public Action ER_KV_CmdReload(int client, int args) { - if (!IsPluginEnabled()) { - return Plugin_Continue; - } + if (!IsPluginEnabled()) { + return Plugin_Continue; + } - ReplyToCommand(client, "[ER] Reloading EntityRemoveData"); - ER_KV_Reload(); + ReplyToCommand(client, "[ER] Reloading EntityRemoveData"); + ER_KV_Reload(); - return Plugin_Handled; + return Plugin_Handled; } static void ER_KV_Reload() { - ER_KV_Close(); - ER_KV_Load(); + ER_KV_Close(); + ER_KV_Load(); } static bool ER_KV_TestCondition(int lhsval, int rhsval, int condition) { - switch (condition) { - case ER_KV_CONDITION_EQUAL: { - return (lhsval == rhsval); - } - case ER_KV_CONDITION_NEQUAL: { - return (lhsval != rhsval); - } - case ER_KV_CONDITION_LESS: { - return (lhsval < rhsval); - } - case ER_KV_CONDITION_GREAT: { - return (lhsval > rhsval); - } - } - - return false; + switch (condition) { + case ER_KV_CONDITION_EQUAL: { + return (lhsval == rhsval); + } + case ER_KV_CONDITION_NEQUAL: { + return (lhsval != rhsval); + } + case ER_KV_CONDITION_LESS: { + return (lhsval < rhsval); + } + case ER_KV_CONDITION_GREAT: { + return (lhsval > rhsval); + } + } + + return false; } static bool ER_KV_TestConditionFloat(float lhsval, float rhsval, int condition) { - switch (condition) { - case ER_KV_CONDITION_EQUAL: { - return (lhsval == rhsval); - } - case ER_KV_CONDITION_NEQUAL: { - return (lhsval != rhsval); - } - case ER_KV_CONDITION_LESS: { - return (lhsval < rhsval); - } - case ER_KV_CONDITION_GREAT: { - return (lhsval > rhsval); - } - } - - return false; + switch (condition) { + case ER_KV_CONDITION_EQUAL: { + return (lhsval == rhsval); + } + case ER_KV_CONDITION_NEQUAL: { + return (lhsval != rhsval); + } + case ER_KV_CONDITION_LESS: { + return (lhsval < rhsval); + } + case ER_KV_CONDITION_GREAT: { + return (lhsval > rhsval); + } + } + + return false; } static bool ER_KV_TestConditionString(const char[] lhsval, const char[] rhsval, int condition) { - switch (condition) { - case ER_KV_CONDITION_EQUAL: { - return (strcmp(lhsval, rhsval) == 0); - } - case ER_KV_CONDITION_NEQUAL: { - return (strcmp(lhsval, rhsval) != 0); - } - case ER_KV_CONDITION_CONTAINS: { - return (StrContains(lhsval, rhsval) != -1); - } - } - - return false; + switch (condition) { + case ER_KV_CONDITION_EQUAL: { + return (strcmp(lhsval, rhsval) == 0); + } + case ER_KV_CONDITION_NEQUAL: { + return (strcmp(lhsval, rhsval) != 0); + } + case ER_KV_CONDITION_CONTAINS: { + return (StrContains(lhsval, rhsval) != -1); + } + } + + return false; } // Returns true if the entity is still alive (not killed) static bool ER_KV_ParseEntity(KeyValues kEntry, int iEntity) { - char sBuffer[64], mapname[64]; - - // Check CVAR for this entry - kEntry.GetString("cvar", sBuffer, sizeof(sBuffer)); - - if (strlen(sBuffer) && !(FindConVarEx(sBuffer).BoolValue)) { - return true; - } - - // Check MapName for this entry - GetCurrentMap(mapname, sizeof(mapname)); - - kEntry.GetString("map", sBuffer, sizeof(sBuffer)); - if (strlen(sBuffer) && StrContains(sBuffer, mapname) == -1) { - return true; - } - - kEntry.GetString("excludemap", sBuffer, sizeof(sBuffer)); - if (strlen(sBuffer) && StrContains(sBuffer, mapname) != -1) { - return true; - } - - // Do property check for this entry - kEntry.GetString("property", sBuffer, sizeof(sBuffer)); - if (strlen(sBuffer)) { - int proptype = kEntry.GetNum("proptype"); - - switch (proptype) { - case ER_KV_PROPTYPE_INT, ER_KV_PROPTYPE_BOOL: { - int rhsval = kEntry.GetNum("propval"); - PropType prop_type = view_as(kEntry.GetNum("propdata")); - int lhsval = GetEntProp(iEntity, prop_type, sBuffer); - - if (!ER_KV_TestCondition(lhsval, rhsval, kEntry.GetNum("condition"))) { - return true; - } - } - case ER_KV_PROPTYPE_FLOAT: { - float rhsval = kEntry.GetFloat("propval"); - PropType prop_type = view_as(kEntry.GetNum("propdata")); - float lhsval = GetEntPropFloat(iEntity, prop_type, sBuffer); - - if (!ER_KV_TestConditionFloat(lhsval, rhsval, kEntry.GetNum("condition"))) { - return true; - } - } - case ER_KV_PROPTYPE_STRING: { - char rhsval[64], lhsval[64]; - kEntry.GetString("propval", rhsval, sizeof(rhsval)); - PropType prop_type = view_as(kEntry.GetNum("propdata")); - GetEntPropString(iEntity, prop_type, sBuffer, lhsval, sizeof(lhsval)); - - if (!ER_KV_TestConditionString(lhsval, rhsval, kEntry.GetNum("condition"))) { - return true; - } - } - } - } - - int iAction = kEntry.GetNum("action"); - return (ER_KV_TakeAction(iAction, iEntity)); + char sBuffer[64], mapname[64]; + + // Check CVAR for this entry + kEntry.GetString("cvar", sBuffer, sizeof(sBuffer)); + + if (strlen(sBuffer) && !(FindConVarEx(sBuffer).BoolValue)) { + return true; + } + + // Check MapName for this entry + GetCurrentMap(mapname, sizeof(mapname)); + + kEntry.GetString("map", sBuffer, sizeof(sBuffer)); + if (strlen(sBuffer) && StrContains(sBuffer, mapname) == -1) { + return true; + } + + kEntry.GetString("excludemap", sBuffer, sizeof(sBuffer)); + if (strlen(sBuffer) && StrContains(sBuffer, mapname) != -1) { + return true; + } + + // Do property check for this entry + kEntry.GetString("property", sBuffer, sizeof(sBuffer)); + if (strlen(sBuffer)) { + int proptype = kEntry.GetNum("proptype"); + + switch (proptype) { + case ER_KV_PROPTYPE_INT, ER_KV_PROPTYPE_BOOL: { + int rhsval = kEntry.GetNum("propval"); + PropType prop_type = view_as(kEntry.GetNum("propdata")); + int lhsval = GetEntProp(iEntity, prop_type, sBuffer); + + if (!ER_KV_TestCondition(lhsval, rhsval, kEntry.GetNum("condition"))) { + return true; + } + } + case ER_KV_PROPTYPE_FLOAT: { + float rhsval = kEntry.GetFloat("propval"); + PropType prop_type = view_as(kEntry.GetNum("propdata")); + float lhsval = GetEntPropFloat(iEntity, prop_type, sBuffer); + + if (!ER_KV_TestConditionFloat(lhsval, rhsval, kEntry.GetNum("condition"))) { + return true; + } + } + case ER_KV_PROPTYPE_STRING: { + char rhsval[64], lhsval[64]; + kEntry.GetString("propval", rhsval, sizeof(rhsval)); + PropType prop_type = view_as(kEntry.GetNum("propdata")); + GetEntPropString(iEntity, prop_type, sBuffer, lhsval, sizeof(lhsval)); + + if (!ER_KV_TestConditionString(lhsval, rhsval, kEntry.GetNum("condition"))) { + return true; + } + } + } + } + + int iAction = kEntry.GetNum("action"); + return (ER_KV_TakeAction(iAction, iEntity)); } // Returns true if the entity is still alive (not killed) static bool ER_KV_TakeAction(int action, int iEntity) { - switch (action) { - case ER_KV_ACTION_KILL: { - if (DEBUG_ER || IsDebugEnabled()) { - LogMessage("[%s] Killing!", ER_MODULE_NAME); - } - - KillEntity(iEntity); - - return false; - } - default: { - Debug_LogError(ER_MODULE_NAME, "ParseEntity Encountered bad action!"); - } - } - - return true; + switch (action) { + case ER_KV_ACTION_KILL: { + if (DEBUG_ER || IsDebugEnabled()) { + LogMessage("[%s] Killing!", ER_MODULE_NAME); + } + + KillEntity(iEntity); + + return false; + } + default: { + Debug_LogError(ER_MODULE_NAME, "ParseEntity Encountered bad action!"); + } + } + + return true; } static bool ER_KillParachutist(int ent) { - char buf[32]; - GetCurrentMap(buf, sizeof(buf)); + char buf[32]; + GetCurrentMap(buf, sizeof(buf)); - if (strcmp(buf, "c3m2_swamp") == 0) { - GetEntPropString(ent, Prop_Data, "m_iName", buf, sizeof(buf)); + if (strcmp(buf, "c3m2_swamp") == 0) { + GetEntPropString(ent, Prop_Data, "m_iName", buf, sizeof(buf)); - if (!strncmp(buf, "parachute_", 10)) { - KillEntity(ent); + if (!strncmp(buf, "parachute_", 10)) { + KillEntity(ent); - return true; - } - } + return true; + } + } - return false; + return false; } static bool ER_ReplaceTriggerHurtGhost(int ent) { - char buf[MAX_ENTITY_NAME_LENGTH]; - GetEdictClassname(ent, buf, sizeof(buf)); - - if (strcmp(buf, "trigger_hurt_ghost") == 0) { - // Replace trigger_hurt_ghost with trigger_hurt - int replace = CreateEntityByName("trigger_hurt"); - if (replace == -1) { - Debug_LogError(ER_MODULE_NAME, "Could not create trigger_hurt entity!"); - return false; - } - - // Get modelname - char model[PLATFORM_MAX_PATH]; - GetEntPropString(ent, Prop_Data, "m_ModelName", model, sizeof(model)); - - // Get position and rotation - float pos[3], ang[3]; - GetEntPropVector(ent, Prop_Send, "m_vecOrigin", pos); - GetEntPropVector(ent, Prop_Send, "m_angRotation", ang); - - // Kill the old one - KillEntity(ent); - - // Set the values for the new one - DispatchKeyValue(replace, "StartDisabled", "0"); - DispatchKeyValue(replace, "spawnflags", "67"); - DispatchKeyValue(replace, "damagetype", "32"); - DispatchKeyValue(replace, "damagemodel", "0"); - DispatchKeyValue(replace, "damagecap", "10000"); - DispatchKeyValue(replace, "damage", "10000"); - DispatchKeyValue(replace, "model", model); - - DispatchKeyValue(replace, "filtername", "filter_infected"); - - // Spawn the new one - TeleportEntity(replace, pos, ang, NULL_VECTOR); - DispatchSpawn(replace); - ActivateEntity(replace); - - return true; - } - - return false; + char buf[MAX_ENTITY_NAME_LENGTH]; + GetEdictClassname(ent, buf, sizeof(buf)); + + if (strcmp(buf, "trigger_hurt_ghost") == 0) { + // Replace trigger_hurt_ghost with trigger_hurt + int replace = CreateEntityByName("trigger_hurt"); + if (replace == -1) { + Debug_LogError(ER_MODULE_NAME, "Could not create trigger_hurt entity!"); + return false; + } + + // Get modelname + char model[PLATFORM_MAX_PATH]; + GetEntPropString(ent, Prop_Data, "m_ModelName", model, sizeof(model)); + + // Get position and rotation + float pos[3], ang[3]; + GetEntPropVector(ent, Prop_Send, "m_vecOrigin", pos); + GetEntPropVector(ent, Prop_Send, "m_angRotation", ang); + + // Kill the old one + KillEntity(ent); + + // Set the values for the new one + DispatchKeyValue(replace, "StartDisabled", "0"); + DispatchKeyValue(replace, "spawnflags", "67"); + DispatchKeyValue(replace, "damagetype", "32"); + DispatchKeyValue(replace, "damagemodel", "0"); + DispatchKeyValue(replace, "damagecap", "10000"); + DispatchKeyValue(replace, "damage", "10000"); + DispatchKeyValue(replace, "model", model); + + DispatchKeyValue(replace, "filtername", "filter_infected"); + + // Spawn the new one + TeleportEntity(replace, pos, ang, NULL_VECTOR); + DispatchSpawn(replace); + ActivateEntity(replace); + + return true; + } + + return false; } public void ER_RoundStart_Event(Event hEvent, const char[] sEventName, bool bdontBroadcast) { - if (!IsPluginEnabled()) { - return; - } + if (!IsPluginEnabled()) { + return; + } - CreateTimer(0.3, ER_RoundStart_Timer, _, TIMER_FLAG_NO_MAPCHANGE); + CreateTimer(0.3, ER_RoundStart_Timer, _, TIMER_FLAG_NO_MAPCHANGE); } public Action ER_RoundStart_Timer(Handle hTimer) { - char sBuffer[MAX_ENTITY_NAME_LENGTH]; - if (DEBUG_ER || IsDebugEnabled()) { - LogMessage("[%s] Starting RoundStart Event", ER_MODULE_NAME); - } - - if (kERData != null) { - kERData.Rewind(); - } - - int iEntCount = GetEntityCount(); - - for (int ent = (MaxClients + 1); ent <= iEntCount; ent++) { - if (!IsValidEdict(ent)) { - continue; - } - - GetEdictClassname(ent, sBuffer, sizeof(sBuffer)); - - if (ER_bKillParachutist && ER_KillParachutist(ent)) { - //empty - } else if (ER_bReplaceGhostHurt && ER_ReplaceTriggerHurtGhost(ent)) { - //empty - } else if (kERData != null && kERData.JumpToKey(sBuffer)) { - if (DEBUG_ER || IsDebugEnabled()) { - LogMessage("[%s] Dealing with an instance of %s", ER_MODULE_NAME, sBuffer); - } - - kERData.GotoFirstSubKey(); - - do { - // Parse each entry for this entity's classname - // Stop if we run out of entries or we have killed the entity - if (!ER_KV_ParseEntity(kERData, ent)) { - break; - } - } while (kERData.GotoNextKey()); - - kERData.Rewind(); - } - } - - return Plugin_Stop; + char sBuffer[MAX_ENTITY_NAME_LENGTH]; + if (DEBUG_ER || IsDebugEnabled()) { + LogMessage("[%s] Starting RoundStart Event", ER_MODULE_NAME); + } + + if (kERData != null) { + kERData.Rewind(); + } + + int iEntCount = GetEntityCount(); + + for (int ent = (MaxClients + 1); ent <= iEntCount; ent++) { + if (!IsValidEdict(ent)) { + continue; + } + + GetEdictClassname(ent, sBuffer, sizeof(sBuffer)); + + if (ER_bKillParachutist && ER_KillParachutist(ent)) { + //empty + } else if (ER_bReplaceGhostHurt && ER_ReplaceTriggerHurtGhost(ent)) { + //empty + } else if (kERData != null && kERData.JumpToKey(sBuffer)) { + if (DEBUG_ER || IsDebugEnabled()) { + LogMessage("[%s] Dealing with an instance of %s", ER_MODULE_NAME, sBuffer); + } + + kERData.GotoFirstSubKey(); + + do { + // Parse each entry for this entity's classname + // Stop if we run out of entries or we have killed the entity + if (!ER_KV_ParseEntity(kERData, ent)) { + break; + } + } while (kERData.GotoNextKey()); + + kERData.Rewind(); + } + } + + return Plugin_Stop; } diff --git a/addons/sourcemod/scripting/confoglcompmod/FinaleSpawn.sp b/addons/sourcemod/scripting/confoglcompmod/FinaleSpawn.sp index 2bd6cd56a..7cc6d7cef 100644 --- a/addons/sourcemod/scripting/confoglcompmod/FinaleSpawn.sp +++ b/addons/sourcemod/scripting/confoglcompmod/FinaleSpawn.sp @@ -1,100 +1,100 @@ #if defined __finale_spawn_included - #endinput + #endinput #endif #define __finale_spawn_included -#define FS_MODULE_NAME "FinaleSpawn" +#define FS_MODULE_NAME "FinaleSpawn" -#define SPAWN_RANGE 150 +#define SPAWN_RANGE 150 static ConVar - FS_hEnabled = null; + FS_hEnabled = null; static bool - FS_bIsFinale = false, - FS_bEnabled = true; + FS_bIsFinale = false, + FS_bEnabled = true; void FS_OnModuleStart() { - FS_hEnabled = CreateConVarEx("reduce_finalespawnrange", "1", "Adjust the spawn range on finales for infected, to normal spawning range", _, true, 0.0, true, 1.0); + FS_hEnabled = CreateConVarEx("reduce_finalespawnrange", "1", "Adjust the spawn range on finales for infected, to normal spawning range", _, true, 0.0, true, 1.0); - FS_bEnabled = FS_hEnabled.BoolValue; - FS_hEnabled.AddChangeHook(FS_ConVarChange); + FS_bEnabled = FS_hEnabled.BoolValue; + FS_hEnabled.AddChangeHook(FS_ConVarChange); - HookEvent("round_end", FS_Round_Event, EventHookMode_PostNoCopy); - HookEvent("round_start", FS_Round_Event, EventHookMode_PostNoCopy); - HookEvent("finale_start", FS_FinaleStart_Event, EventHookMode_PostNoCopy); + HookEvent("round_end", FS_Round_Event, EventHookMode_PostNoCopy); + HookEvent("round_start", FS_Round_Event, EventHookMode_PostNoCopy); + HookEvent("finale_start", FS_FinaleStart_Event, EventHookMode_PostNoCopy); } public void FS_Round_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - FS_bIsFinale = false; + FS_bIsFinale = false; } public void FS_FinaleStart_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - FS_bIsFinale = true; + FS_bIsFinale = true; } public void FS_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - FS_bEnabled = FS_hEnabled.BoolValue; + FS_bEnabled = FS_hEnabled.BoolValue; } void FS_OnClientPutInServer(int client) { - SDKHook(client, SDKHook_PreThinkPost, HookCallback); + SDKHook(client, SDKHook_PreThinkPost, HookCallback); } public void HookCallback(int client) { - if (!FS_bIsFinale) { - return; - } - - //if (!FS_bEnabled) { // rework version - if (!FS_bEnabled || !IsPluginEnabled()) { // original - return; - } - - if (GetClientTeam(client) != L4D2Team_Infected) { - return; - } - - if (GetEntProp(client, Prop_Send, "m_isGhost", 1) != 1) { - return; - } - - if (GetEntProp(client, Prop_Send, "m_ghostSpawnState") == SPAWNFLAG_TOOCLOSE) { - if (!TooClose(client)) { - SetEntProp(client, Prop_Send, "m_ghostSpawnState", SPAWNFLAG_READY); - } - } + if (!FS_bIsFinale) { + return; + } + + //if (!FS_bEnabled) { // rework version + if (!FS_bEnabled || !IsPluginEnabled()) { // original + return; + } + + if (GetClientTeam(client) != L4D2Team_Infected) { + return; + } + + if (GetEntProp(client, Prop_Send, "m_isGhost", 1) != 1) { + return; + } + + if (GetEntProp(client, Prop_Send, "m_ghostSpawnState") == SPAWNFLAG_TOOCLOSE) { + if (!TooClose(client)) { + SetEntProp(client, Prop_Send, "m_ghostSpawnState", SPAWNFLAG_READY); + } + } } static bool TooClose(int client) { - int index = 0; - float fInfLocation[3], fSurvLocation[3], fVector[3]; - GetClientAbsOrigin(client, fInfLocation); + int index = 0; + float fInfLocation[3], fSurvLocation[3], fVector[3]; + GetClientAbsOrigin(client, fInfLocation); - for (int i = 0; i < 4; i++) { - index = GetSurvivorIndex(i); - if (index == 0) { - continue; - } + for (int i = 0; i < 4; i++) { + index = GetSurvivorIndex(i); + if (index == 0) { + continue; + } - if (!IsPlayerAlive(index)) { - continue; - } + if (!IsPlayerAlive(index)) { + continue; + } - GetClientAbsOrigin(index, fSurvLocation); - MakeVectorFromPoints(fInfLocation, fSurvLocation, fVector); + GetClientAbsOrigin(index, fSurvLocation); + MakeVectorFromPoints(fInfLocation, fSurvLocation, fVector); - if (GetVectorLength(fVector) <= SPAWN_RANGE) { - return true; - } - } + if (GetVectorLength(fVector) <= SPAWN_RANGE) { + return true; + } + } - return false; + return false; } diff --git a/addons/sourcemod/scripting/confoglcompmod/GhostTank.sp b/addons/sourcemod/scripting/confoglcompmod/GhostTank.sp index b21893138..97623aac3 100644 --- a/addons/sourcemod/scripting/confoglcompmod/GhostTank.sp +++ b/addons/sourcemod/scripting/confoglcompmod/GhostTank.sp @@ -1,346 +1,346 @@ #if defined __ghost_tank_included - #endinput + #endinput #endif #define __ghost_tank_included -#define GT_MODULE_NAME "GhostTank" +#define GT_MODULE_NAME "GhostTank" -#define THROWRANGE 99999999.0 -#define FIREIMMUNITY_TIME 5.0 +#define THROWRANGE 99999999.0 +#define FIREIMMUNITY_TIME 5.0 static int - g_iPasses = 0, - g_iGT_TankClient = 0; + g_iPasses = 0, + g_iGT_TankClient = 0; static bool - g_bGT_FinaleVehicleIncoming = false, - g_bGT_TankIsInPlay = false, - g_bGT_TankHasFireImmunity = false, - g_bGT_HordesDisabled = false; + g_bGT_FinaleVehicleIncoming = false, + g_bGT_TankIsInPlay = false, + g_bGT_TankHasFireImmunity = false, + g_bGT_HordesDisabled = false; static Handle - g_hGT_TankDeathTimer = null; + g_hGT_TankDeathTimer = null; static ConVar - g_hGT_Enabled = null, - g_hCvarTankThrowAllowRange = null, - g_hCvarDirectorTankLotterySelectionTime = null, - g_hCvarZMobSpawnMinIntervalNormal = null, - g_hCvarZMobSpawnMaxIntervalNormal = null, - g_hCvarMobSpawnMinSize = null, - g_hCvarMobSpawnMaxSize = null, - g_hCvarSurvivorIncapHealth = null, - g_hGT_RemoveEscapeTank = null, - g_hGT_BlockPunchRock = null, - g_hGT_DisableTankHordes = null; // Disable Tank Hordes items + g_hGT_Enabled = null, + g_hCvarTankThrowAllowRange = null, + g_hCvarDirectorTankLotterySelectionTime = null, + g_hCvarZMobSpawnMinIntervalNormal = null, + g_hCvarZMobSpawnMaxIntervalNormal = null, + g_hCvarMobSpawnMinSize = null, + g_hCvarMobSpawnMaxSize = null, + g_hCvarSurvivorIncapHealth = null, + g_hGT_RemoveEscapeTank = null, + g_hGT_BlockPunchRock = null, + g_hGT_DisableTankHordes = null; // Disable Tank Hordes items void GT_OnModuleStart() { - g_hGT_Enabled = CreateConVarEx( \ - "boss_tank", \ - "1", \ - "Tank can't be prelight, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player", \ - _, true, 0.0, true, 1.0 \ - ); - - g_hGT_RemoveEscapeTank = CreateConVarEx("remove_escape_tank", "1", "Remove tanks that spawn as the rescue vehicle is incoming on finales.", _, true, 0.0, true, 1.0); - g_hGT_DisableTankHordes = CreateConVarEx("disable_tank_hordes", "0", "Disable natural hordes while tanks are in play", _, true, 0.0, true, 1.0); - g_hGT_BlockPunchRock = CreateConVarEx("block_punch_rock", "0", "Block tanks from punching and throwing a rock at the same time", _, true, 0.0, true, 1.0); - - g_hCvarSurvivorIncapHealth = FindConVar("survivor_incap_health"); - g_hCvarTankThrowAllowRange = FindConVar("tank_throw_allow_range"); - g_hCvarDirectorTankLotterySelectionTime = FindConVar("director_tank_lottery_selection_time"); - g_hCvarZMobSpawnMinIntervalNormal = FindConVar("z_mob_spawn_min_interval_normal"); - g_hCvarZMobSpawnMaxIntervalNormal = FindConVar("z_mob_spawn_max_interval_normal"); - g_hCvarMobSpawnMinSize = FindConVar("z_mob_spawn_min_size"); - g_hCvarMobSpawnMaxSize = FindConVar("z_mob_spawn_max_size"); - - HookEvent("round_start", GT_RoundStart, EventHookMode_PostNoCopy); - HookEvent("tank_spawn", GT_TankSpawn); - HookEvent("player_death", GT_TankKilled); - HookEvent("player_hurt", GT_TankOnFire); - HookEvent("item_pickup", GT_ItemPickup); - HookEvent("player_incapacitated", GT_PlayerIncap); - HookEvent("finale_vehicle_incoming", GT_FinaleVehicleIncoming, EventHookMode_PostNoCopy); - HookEvent("finale_vehicle_ready", GT_FinaleVehicleIncoming, EventHookMode_PostNoCopy); + g_hGT_Enabled = CreateConVarEx( \ + "boss_tank", \ + "1", \ + "Tank can't be prelight, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player", \ + _, true, 0.0, true, 1.0 \ + ); + + g_hGT_RemoveEscapeTank = CreateConVarEx("remove_escape_tank", "1", "Remove tanks that spawn as the rescue vehicle is incoming on finales.", _, true, 0.0, true, 1.0); + g_hGT_DisableTankHordes = CreateConVarEx("disable_tank_hordes", "0", "Disable natural hordes while tanks are in play", _, true, 0.0, true, 1.0); + g_hGT_BlockPunchRock = CreateConVarEx("block_punch_rock", "0", "Block tanks from punching and throwing a rock at the same time", _, true, 0.0, true, 1.0); + + g_hCvarSurvivorIncapHealth = FindConVar("survivor_incap_health"); + g_hCvarTankThrowAllowRange = FindConVar("tank_throw_allow_range"); + g_hCvarDirectorTankLotterySelectionTime = FindConVar("director_tank_lottery_selection_time"); + g_hCvarZMobSpawnMinIntervalNormal = FindConVar("z_mob_spawn_min_interval_normal"); + g_hCvarZMobSpawnMaxIntervalNormal = FindConVar("z_mob_spawn_max_interval_normal"); + g_hCvarMobSpawnMinSize = FindConVar("z_mob_spawn_min_size"); + g_hCvarMobSpawnMaxSize = FindConVar("z_mob_spawn_max_size"); + + HookEvent("round_start", GT_RoundStart, EventHookMode_PostNoCopy); + HookEvent("tank_spawn", GT_TankSpawn); + HookEvent("player_death", GT_TankKilled); + HookEvent("player_hurt", GT_TankOnFire); + HookEvent("item_pickup", GT_ItemPickup); + HookEvent("player_incapacitated", GT_PlayerIncap); + HookEvent("finale_vehicle_incoming", GT_FinaleVehicleIncoming, EventHookMode_PostNoCopy); + HookEvent("finale_vehicle_ready", GT_FinaleVehicleIncoming, EventHookMode_PostNoCopy); } Action GT_OnTankSpawn_Forward() { - if (IsPluginEnabled() && g_hGT_RemoveEscapeTank.BoolValue && g_bGT_FinaleVehicleIncoming) { - return Plugin_Handled; - } + if (IsPluginEnabled() && g_hGT_RemoveEscapeTank.BoolValue && g_bGT_FinaleVehicleIncoming) { + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; } Action GT_OnCThrowActivate() { - if (IsPluginEnabled() - && g_bGT_TankIsInPlay - && g_hGT_BlockPunchRock.BoolValue - && GetClientButtons(g_iGT_TankClient) & IN_ATTACK - ) { - if (IsDebugEnabled()) { - LogMessage("[%s] Blocking Haymaker on %L", GT_MODULE_NAME, g_iGT_TankClient); - } - - return Plugin_Handled; - } - - return Plugin_Continue; + if (IsPluginEnabled() + && g_bGT_TankIsInPlay + && g_hGT_BlockPunchRock.BoolValue + && GetClientButtons(g_iGT_TankClient) & IN_ATTACK + ) { + if (IsDebugEnabled()) { + LogMessage("[%s] Blocking Haymaker on %L", GT_MODULE_NAME, g_iGT_TankClient); + } + + return Plugin_Handled; + } + + return Plugin_Continue; } Action GT_OnSpawnMob_Forward(int &amount) { - // quick fix. needs normalize_hordes 1 - if (IsPluginEnabled()) { - if (IsDebugEnabled()) { - LogMessage("[%s] SpawnMob(%d), HordesDisabled: %d TimerDuration: %f Minimum: %f Remaining: %f", \ - GT_MODULE_NAME, amount, g_bGT_HordesDisabled, L4D2_CTimerGetCountdownDuration(L4D2CT_MobSpawnTimer), \ - g_hCvarZMobSpawnMinIntervalNormal.FloatValue, L4D2_CTimerGetRemainingTime(L4D2CT_MobSpawnTimer)); - } - - if (g_bGT_HordesDisabled) { - if (amount < g_hCvarMobSpawnMinSize.IntValue || amount > g_hCvarMobSpawnMaxSize.IntValue) { - return Plugin_Continue; - } - - if (!L4D2_CTimerIsElapsed(L4D2CT_MobSpawnTimer)) { - return Plugin_Continue; - } - - float duration = L4D2_CTimerGetCountdownDuration(L4D2CT_MobSpawnTimer); - if (duration < g_hCvarZMobSpawnMinIntervalNormal.FloatValue || duration > g_hCvarZMobSpawnMaxIntervalNormal.FloatValue) { - return Plugin_Continue; - } - - return Plugin_Handled; - } - } - - return Plugin_Continue; + // quick fix. needs normalize_hordes 1 + if (IsPluginEnabled()) { + if (IsDebugEnabled()) { + LogMessage("[%s] SpawnMob(%d), HordesDisabled: %d TimerDuration: %f Minimum: %f Remaining: %f", \ + GT_MODULE_NAME, amount, g_bGT_HordesDisabled, L4D2_CTimerGetCountdownDuration(L4D2CT_MobSpawnTimer), \ + g_hCvarZMobSpawnMinIntervalNormal.FloatValue, L4D2_CTimerGetRemainingTime(L4D2CT_MobSpawnTimer)); + } + + if (g_bGT_HordesDisabled) { + if (amount < g_hCvarMobSpawnMinSize.IntValue || amount > g_hCvarMobSpawnMaxSize.IntValue) { + return Plugin_Continue; + } + + if (!L4D2_CTimerIsElapsed(L4D2CT_MobSpawnTimer)) { + return Plugin_Continue; + } + + float duration = L4D2_CTimerGetCountdownDuration(L4D2CT_MobSpawnTimer); + if (duration < g_hCvarZMobSpawnMinIntervalNormal.FloatValue || duration > g_hCvarZMobSpawnMaxIntervalNormal.FloatValue) { + return Plugin_Continue; + } + + return Plugin_Handled; + } + } + + return Plugin_Continue; } // Disable stasis when we're using GhostTank Action GT_OnTryOfferingTankBot(bool &enterStasis) { - g_iPasses++; + g_iPasses++; - if (IsPluginEnabled()) { - if (g_hGT_Enabled.BoolValue) { - enterStasis = false; - } + if (IsPluginEnabled()) { + if (g_hGT_Enabled.BoolValue) { + enterStasis = false; + } - if (g_hGT_RemoveEscapeTank.BoolValue && g_bGT_FinaleVehicleIncoming) { - return Plugin_Handled; - } - } + if (g_hGT_RemoveEscapeTank.BoolValue && g_bGT_FinaleVehicleIncoming) { + return Plugin_Handled; + } + } - return Plugin_Continue; + return Plugin_Continue; } public void GT_FinaleVehicleIncoming(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - g_bGT_FinaleVehicleIncoming = true; + g_bGT_FinaleVehicleIncoming = true; - if (g_bGT_TankIsInPlay && IsFakeClient(g_iGT_TankClient)) { - KickClient(g_iGT_TankClient); - GT_Reset(); - } + if (g_bGT_TankIsInPlay && IsFakeClient(g_iGT_TankClient)) { + KickClient(g_iGT_TankClient); + GT_Reset(); + } } public void GT_ItemPickup(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!g_bGT_TankIsInPlay) { - return; - } + if (!g_bGT_TankIsInPlay) { + return; + } - char item[MAX_ENTITY_NAME_LENGTH]; - hEvent.GetString("item", item, sizeof(item)); + char item[MAX_ENTITY_NAME_LENGTH]; + hEvent.GetString("item", item, sizeof(item)); - if (strcmp(item, "tank_claw") != 0) { - return; - } + if (strcmp(item, "tank_claw") != 0) { + return; + } - g_iGT_TankClient = GetClientOfUserId(hEvent.GetInt("userid")); + g_iGT_TankClient = GetClientOfUserId(hEvent.GetInt("userid")); - if (g_hGT_TankDeathTimer != null) { - KillTimer(g_hGT_TankDeathTimer); - g_hGT_TankDeathTimer = null; - } + if (g_hGT_TankDeathTimer != null) { + KillTimer(g_hGT_TankDeathTimer); + g_hGT_TankDeathTimer = null; + } } public void GT_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - g_bGT_FinaleVehicleIncoming = false; - GT_Reset(); + g_bGT_FinaleVehicleIncoming = false; + GT_Reset(); } public void GT_TankKilled(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!g_bGT_TankIsInPlay) { - return; - } + if (!g_bGT_TankIsInPlay) { + return; + } - int client = GetClientOfUserId(hEvent.GetInt("userid")); - if (client != g_iGT_TankClient) { - return; - } + int client = GetClientOfUserId(hEvent.GetInt("userid")); + if (client != g_iGT_TankClient) { + return; + } - g_hGT_TankDeathTimer = CreateTimer(1.0, GT_TankKilled_Timer); + g_hGT_TankDeathTimer = CreateTimer(1.0, GT_TankKilled_Timer); } public void GT_TankSpawn(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - int client = GetClientOfUserId(hEvent.GetInt("userid")); - g_iGT_TankClient = client; + int client = GetClientOfUserId(hEvent.GetInt("userid")); + g_iGT_TankClient = client; - if (g_bGT_TankIsInPlay) { - return; - } + if (g_bGT_TankIsInPlay) { + return; + } - g_bGT_TankIsInPlay = true; + g_bGT_TankIsInPlay = true; - if (g_hGT_DisableTankHordes.BoolValue) { - g_bGT_HordesDisabled = true; - } + if (g_hGT_DisableTankHordes.BoolValue) { + g_bGT_HordesDisabled = true; + } - if (!IsPluginEnabled() || !g_hGT_Enabled.BoolValue) { - return; - } + if (!IsPluginEnabled() || !g_hGT_Enabled.BoolValue) { + return; + } - float fFireImmunityTime = FIREIMMUNITY_TIME; - float fSelectionTime = g_hCvarDirectorTankLotterySelectionTime.FloatValue; + float fFireImmunityTime = FIREIMMUNITY_TIME; + float fSelectionTime = g_hCvarDirectorTankLotterySelectionTime.FloatValue; - if (IsFakeClient(client)) { - GT_PauseTank(); - CreateTimer(fSelectionTime, GT_ResumeTankTimer); - fFireImmunityTime += fSelectionTime; - } + if (IsFakeClient(client)) { + GT_PauseTank(); + CreateTimer(fSelectionTime, GT_ResumeTankTimer); + fFireImmunityTime += fSelectionTime; + } - CreateTimer(fFireImmunityTime, GT_FireImmunityTimer); + CreateTimer(fFireImmunityTime, GT_FireImmunityTimer); } public void GT_TankOnFire(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - int dmgtype = hEvent.GetInt("type"); + int dmgtype = hEvent.GetInt("type"); - if (!(dmgtype & DMG_BURN)) { //more performance - return; - } + if (!(dmgtype & DMG_BURN)) { //more performance + return; + } - if (!g_bGT_TankIsInPlay || !g_bGT_TankHasFireImmunity || !IsPluginEnabled() || !g_hGT_Enabled.BoolValue) { - return; - } + if (!g_bGT_TankIsInPlay || !g_bGT_TankHasFireImmunity || !IsPluginEnabled() || !g_hGT_Enabled.BoolValue) { + return; + } - int client = GetClientOfUserId(hEvent.GetInt("userid")); - if (client < 1 || g_iGT_TankClient != client || !IsClientInGame(client) || GetClientTeam(client) != L4D2Team_Infected) { - return; - } + int client = GetClientOfUserId(hEvent.GetInt("userid")); + if (client < 1 || g_iGT_TankClient != client || !IsClientInGame(client) || GetClientTeam(client) != L4D2Team_Infected) { + return; + } - ExtinguishEntity(client); + ExtinguishEntity(client); - int iSetHealth = GetClientHealth(client) + hEvent.GetInt("dmg_health"); - SetEntityHealth(client, iSetHealth); + int iSetHealth = GetClientHealth(client) + hEvent.GetInt("dmg_health"); + SetEntityHealth(client, iSetHealth); } public void GT_PlayerIncap(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!g_bGT_TankIsInPlay || !IsPluginEnabled() || !g_hGT_Enabled.BoolValue) { - return; - } + if (!g_bGT_TankIsInPlay || !IsPluginEnabled() || !g_hGT_Enabled.BoolValue) { + return; + } - char weapon[MAX_ENTITY_NAME_LENGTH]; - hEvent.GetString("weapon", weapon, sizeof(weapon)); + char weapon[MAX_ENTITY_NAME_LENGTH]; + hEvent.GetString("weapon", weapon, sizeof(weapon)); - if (strcmp(weapon, "tank_claw") != 0) { - return; - } + if (strcmp(weapon, "tank_claw") != 0) { + return; + } - int userid = hEvent.GetInt("userid"); - int client = GetClientOfUserId(userid); - if (client < 1 || !IsClientInGame(client) || GetClientTeam(client) != L4D2Team_Survivor) { - return; - } + int userid = hEvent.GetInt("userid"); + int client = GetClientOfUserId(userid); + if (client < 1 || !IsClientInGame(client) || GetClientTeam(client) != L4D2Team_Survivor) { + return; + } - SetEntProp(client, Prop_Send, "m_isIncapacitated", 0, 1); - SetEntityHealth(client, 1); + SetEntProp(client, Prop_Send, "m_isIncapacitated", 0, 1); + SetEntityHealth(client, 1); - CreateTimer(0.4, GT_IncapTimer, userid, TIMER_FLAG_NO_MAPCHANGE); + CreateTimer(0.4, GT_IncapTimer, userid, TIMER_FLAG_NO_MAPCHANGE); } public Action GT_IncapTimer(Handle hTimer, int userid) { - int client = GetClientOfUserId(userid); - if (client > 0) { - SetEntProp(client, Prop_Send, "m_isIncapacitated", 1, 1); - SetEntityHealth(client, g_hCvarSurvivorIncapHealth.IntValue); - } + int client = GetClientOfUserId(userid); + if (client > 0) { + SetEntProp(client, Prop_Send, "m_isIncapacitated", 1, 1); + SetEntityHealth(client, g_hCvarSurvivorIncapHealth.IntValue); + } - return Plugin_Stop; + return Plugin_Stop; } public Action GT_ResumeTankTimer(Handle hTimer) { - GT_ResumeTank(); + GT_ResumeTank(); - return Plugin_Stop; + return Plugin_Stop; } public Action GT_FireImmunityTimer(Handle hTimer) { - g_bGT_TankHasFireImmunity = false; + g_bGT_TankHasFireImmunity = false; - return Plugin_Stop; + return Plugin_Stop; } static void GT_PauseTank() { - g_hCvarTankThrowAllowRange.SetFloat(THROWRANGE); + g_hCvarTankThrowAllowRange.SetFloat(THROWRANGE); - if (!IsValidEntity(g_iGT_TankClient)) { - return; - } + if (!IsValidEntity(g_iGT_TankClient)) { + return; + } - SetEntityMoveType(g_iGT_TankClient, MOVETYPE_NONE); - SetEntProp(g_iGT_TankClient, Prop_Send, "m_isGhost", 1, 1); + SetEntityMoveType(g_iGT_TankClient, MOVETYPE_NONE); + SetEntProp(g_iGT_TankClient, Prop_Send, "m_isGhost", 1, 1); } static void GT_ResumeTank() { - g_hCvarTankThrowAllowRange.RestoreDefault(); + g_hCvarTankThrowAllowRange.RestoreDefault(); - if (!IsValidEntity(g_iGT_TankClient)) { - return; - } + if (!IsValidEntity(g_iGT_TankClient)) { + return; + } - SetEntityMoveType(g_iGT_TankClient, MOVETYPE_CUSTOM); - SetEntProp(g_iGT_TankClient, Prop_Send, "m_isGhost", 0, 1); + SetEntityMoveType(g_iGT_TankClient, MOVETYPE_CUSTOM); + SetEntProp(g_iGT_TankClient, Prop_Send, "m_isGhost", 0, 1); } static void GT_Reset() { - g_iPasses = 0; - g_hGT_TankDeathTimer = null; + g_iPasses = 0; + g_hGT_TankDeathTimer = null; - if (g_bGT_HordesDisabled) { - g_bGT_HordesDisabled = false; - } + if (g_bGT_HordesDisabled) { + g_bGT_HordesDisabled = false; + } - g_bGT_TankIsInPlay = false; - g_bGT_TankHasFireImmunity = true; + g_bGT_TankIsInPlay = false; + g_bGT_TankHasFireImmunity = true; } public Action GT_TankKilled_Timer(Handle hTimer) { - GT_Reset(); + GT_Reset(); - return Plugin_Stop; + return Plugin_Stop; } // For other modules to use stock bool GT_IsTankInPlay() { - return (g_bGT_TankIsInPlay); + return (g_bGT_TankIsInPlay); } diff --git a/addons/sourcemod/scripting/confoglcompmod/GhostWarp.sp b/addons/sourcemod/scripting/confoglcompmod/GhostWarp.sp index 076e7a23f..762798bf0 100644 --- a/addons/sourcemod/scripting/confoglcompmod/GhostWarp.sp +++ b/addons/sourcemod/scripting/confoglcompmod/GhostWarp.sp @@ -1,176 +1,176 @@ #if defined __ghost_warp_included - #endinput + #endinput #endif #define __ghost_warp_included -#define GW_MODULE_NAME "GhostWarp" +#define GW_MODULE_NAME "GhostWarp" static int - GW_iLastTarget[MAXPLAYERS + 1] = {-1, ...}; + GW_iLastTarget[MAXPLAYERS + 1] = {-1, ...}; static bool - GW_bEnabled = true, - GW_bReload = false, - GW_bDelay[MAXPLAYERS + 1] = {false, ...}; + GW_bEnabled = true, + GW_bReload = false, + GW_bDelay[MAXPLAYERS + 1] = {false, ...}; static ConVar - GW_hGhostWarp = null, - GW_hGhostWarpReload = null; + GW_hGhostWarp = null, + GW_hGhostWarpReload = null; void GW_OnModuleStart() { - // GhostWarp - GW_hGhostWarp = CreateConVarEx("ghost_warp", "1", "Sets whether infected ghosts can right click for warp to next survivor", _, true, 0.0, true, 1.0); - GW_hGhostWarpReload = CreateConVarEx("ghost_warp_reload", "0", "Sets whether to use mouse2 or reload for ghost warp.", _, true, 0.0, true, 1.0); + // GhostWarp + GW_hGhostWarp = CreateConVarEx("ghost_warp", "1", "Sets whether infected ghosts can right click for warp to next survivor", _, true, 0.0, true, 1.0); + GW_hGhostWarpReload = CreateConVarEx("ghost_warp_reload", "0", "Sets whether to use mouse2 or reload for ghost warp.", _, true, 0.0, true, 1.0); - // Ghost Warp - GW_bEnabled = GW_hGhostWarp.BoolValue; - GW_bReload = GW_hGhostWarpReload.BoolValue; + // Ghost Warp + GW_bEnabled = GW_hGhostWarp.BoolValue; + GW_bReload = GW_hGhostWarpReload.BoolValue; - GW_hGhostWarp.AddChangeHook(GW_ConVarsChanged); - GW_hGhostWarpReload.AddChangeHook(GW_ConVarsChanged); + GW_hGhostWarp.AddChangeHook(GW_ConVarsChanged); + GW_hGhostWarpReload.AddChangeHook(GW_ConVarsChanged); - RegConsoleCmd("sm_warptosurvivor", GW_Cmd_WarpToSurvivor); + RegConsoleCmd("sm_warptosurvivor", GW_Cmd_WarpToSurvivor); - HookEvent("player_death", GW_PlayerDeath_Event); - HookEvent("round_start", GW_RoundStart); + HookEvent("player_death", GW_PlayerDeath_Event); + HookEvent("round_start", GW_RoundStart); } public void GW_ConVarsChanged(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - GW_bEnabled = GW_hGhostWarp.BoolValue; - GW_bReload = GW_hGhostWarpReload.BoolValue; + GW_bEnabled = GW_hGhostWarp.BoolValue; + GW_bReload = GW_hGhostWarpReload.BoolValue; } bool GW_OnPlayerRunCmd(int iClient, int iButtons) { - if (!IsPluginEnabled() || !GW_bEnabled || GW_bDelay[iClient]) { - return false; - } + if (!IsPluginEnabled() || !GW_bEnabled || GW_bDelay[iClient]) { + return false; + } - if (/*!IsClientInGame(iClient) || */GetClientTeam(iClient) != L4D2Team_Infected || GetEntProp(iClient, Prop_Send, "m_isGhost", 1) != 1) { - return false; - } + if (/*!IsClientInGame(iClient) || */GetClientTeam(iClient) != L4D2Team_Infected || GetEntProp(iClient, Prop_Send, "m_isGhost", 1) != 1) { + return false; + } - if (GW_bReload && !(iButtons & IN_RELOAD)) { - return false; - } + if (GW_bReload && !(iButtons & IN_RELOAD)) { + return false; + } - if (!GW_bReload && !(iButtons & IN_ATTACK2)) { - return false; - } + if (!GW_bReload && !(iButtons & IN_ATTACK2)) { + return false; + } - GW_bDelay[iClient] = true; - CreateTimer(0.25, GW_ResetDelay, iClient, TIMER_FLAG_NO_MAPCHANGE); - GW_WarpToSurvivor(iClient, 0); + GW_bDelay[iClient] = true; + CreateTimer(0.25, GW_ResetDelay, iClient, TIMER_FLAG_NO_MAPCHANGE); + GW_WarpToSurvivor(iClient, 0); - return true; + return true; } public void GW_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - for (int i = 1; i <= MaxClients; i++) { - GW_bDelay[i] = false; - GW_iLastTarget[i] = -1; - } + for (int i = 1; i <= MaxClients; i++) { + GW_bDelay[i] = false; + GW_iLastTarget[i] = -1; + } } public void GW_PlayerDeath_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - int iClient = GetClientOfUserId(hEvent.GetInt("userid")); + int iClient = GetClientOfUserId(hEvent.GetInt("userid")); - GW_iLastTarget[iClient] = -1; + GW_iLastTarget[iClient] = -1; } public Action GW_ResetDelay(Handle hTimer, any iClient) { - GW_bDelay[iClient] = false; + GW_bDelay[iClient] = false; - return Plugin_Stop; + return Plugin_Stop; } public Action GW_Cmd_WarpToSurvivor(int iClient, int iArgs) { - if (iClient < 1 || iArgs != 1) { - return Plugin_Handled; - } + if (iClient < 1 || iArgs != 1) { + return Plugin_Handled; + } - if (!IsPluginEnabled() || !GW_bEnabled) { - return Plugin_Handled; - } + if (!IsPluginEnabled() || !GW_bEnabled) { + return Plugin_Handled; + } - if (GetClientTeam(iClient) != L4D2Team_Infected || GetEntProp(iClient, Prop_Send, "m_isGhost", 1) != 1) { - return Plugin_Handled; - } + if (GetClientTeam(iClient) != L4D2Team_Infected || GetEntProp(iClient, Prop_Send, "m_isGhost", 1) != 1) { + return Plugin_Handled; + } - char sBuffer[2]; - GetCmdArg(1, sBuffer, sizeof(sBuffer)); - if (strlen(sBuffer) == 0) { - return Plugin_Handled; - } + char sBuffer[2]; + GetCmdArg(1, sBuffer, sizeof(sBuffer)); + if (strlen(sBuffer) == 0) { + return Plugin_Handled; + } - int iCharacter = StringToInt(sBuffer); - GW_WarpToSurvivor(iClient, iCharacter); + int iCharacter = StringToInt(sBuffer); + GW_WarpToSurvivor(iClient, iCharacter); - return Plugin_Handled; + return Plugin_Handled; } static void GW_WarpToSurvivor(int iClient, int iCharacter) { - int iTarget = 0; + int iTarget = 0; - if (iCharacter <= 0) { - iTarget = GW_FindNextSurvivor(iClient, GW_iLastTarget[iClient]); - } else if (iCharacter <= 4) { - iTarget = GetSurvivorIndex(iCharacter - 1); - } else { - return; - } + if (iCharacter <= 0) { + iTarget = GW_FindNextSurvivor(iClient, GW_iLastTarget[iClient]); + } else if (iCharacter <= 4) { + iTarget = GetSurvivorIndex(iCharacter - 1); + } else { + return; + } - if (iTarget == 0) { - return; - } + if (iTarget == 0) { + return; + } - // Prevent people from spawning and then warp to survivor - SetEntProp(iClient, Prop_Send, "m_ghostSpawnState", SPAWNFLAG_TOOCLOSE); + // Prevent people from spawning and then warp to survivor + SetEntProp(iClient, Prop_Send, "m_ghostSpawnState", SPAWNFLAG_TOOCLOSE); - float fPosition[3], fAnglestarget[3]; - GetClientAbsOrigin(iTarget, fPosition); - GetClientAbsAngles(iTarget, fAnglestarget); + float fPosition[3], fAnglestarget[3]; + GetClientAbsOrigin(iTarget, fPosition); + GetClientAbsAngles(iTarget, fAnglestarget); - TeleportEntity(iClient, fPosition, fAnglestarget, NULL_VECTOR); + TeleportEntity(iClient, fPosition, fAnglestarget, NULL_VECTOR); } static int GW_FindNextSurvivor(int iClient, int iCharacter) { - if (!IsAnySurvivorsAlive()) { - return 0; - } + if (!IsAnySurvivorsAlive()) { + return 0; + } - bool bHavelooped = false; - iCharacter++; + bool bHavelooped = false; + iCharacter++; - if (iCharacter >= NUM_OF_SURVIVORS) { - iCharacter = 0; - } + if (iCharacter >= NUM_OF_SURVIVORS) { + iCharacter = 0; + } - for (int i = iCharacter; i <= MaxClients; i++) { - if (i >= NUM_OF_SURVIVORS) { - if (bHavelooped) { - break; - } + for (int i = iCharacter; i <= MaxClients; i++) { + if (i >= NUM_OF_SURVIVORS) { + if (bHavelooped) { + break; + } - bHavelooped = true; - i = 0; - } + bHavelooped = true; + i = 0; + } - if (GetSurvivorIndex(i) == 0) { - continue; - } + if (GetSurvivorIndex(i) == 0) { + continue; + } - GW_iLastTarget[iClient] = i; - return GetSurvivorIndex(i); - } + GW_iLastTarget[iClient] = i; + return GetSurvivorIndex(i); + } - return 0; + return 0; } diff --git a/addons/sourcemod/scripting/confoglcompmod/ItemTracking.sp b/addons/sourcemod/scripting/confoglcompmod/ItemTracking.sp index 9ef1f9082..546f6b529 100644 --- a/addons/sourcemod/scripting/confoglcompmod/ItemTracking.sp +++ b/addons/sourcemod/scripting/confoglcompmod/ItemTracking.sp @@ -3,7 +3,7 @@ #endif #define __item_tracking_included -#define IT_MODULE_NAME "ItemTracking" +#define IT_MODULE_NAME "ItemTracking" // Item lists for tracking/decoding/etc enum /*ItemList*/ @@ -207,7 +207,7 @@ public void _IT_RoundStartEvent(Event hEvent, const char[] sEventName, bool bDon g_iSaferoomCount[START_SAFEROOM - 1] = 0; g_iSaferoomCount[END_SAFEROOM - 1] = 0; - // Since OnMapStart only happens once on scavenge mode, g_bIsRound1Over can only be once false because + // Since OnMapStart only happens once on scavenge mode, g_bIsRound1Over can only be once false because // evey round_end event will turn it to true. This casues items spawning at the same position during the whole scavenge match. if (IsScavengeMode()) { if (!InSecondHalfOfRound()) { @@ -275,7 +275,7 @@ static void GenerateStoredSpawns() }*/ // Produces the lookup trie for weapon spawn entities -// to translate to our ADT array of spawns +// to translate to our ADT array of spawns static void CreateItemListTrie() { g_hItemListTrie = new StringMap(); @@ -313,7 +313,7 @@ static void KillRegisteredItems() // Exception for if the item is in a player's inventory. if (bKeepPlayerItems && HasEntProp(i, Prop_Send, "m_hOwner") && GetEntPropEnt(i, Prop_Send, "m_hOwner") > 0) continue; - + KillEntity(i); /*if (!AcceptEntityInput(i, "kill")) { Debug_LogError(IT_MODULE_NAME, "Error killing instance of item %s", g_sItemNames[itemindex][IN_longname]); diff --git a/addons/sourcemod/scripting/confoglcompmod/MapInfo.sp b/addons/sourcemod/scripting/confoglcompmod/MapInfo.sp index a095b785d..8708758c8 100644 --- a/addons/sourcemod/scripting/confoglcompmod/MapInfo.sp +++ b/addons/sourcemod/scripting/confoglcompmod/MapInfo.sp @@ -1,434 +1,434 @@ #if defined __map_info_included - #endinput + #endinput #endif #define __map_info_included -#define DEBUG_MI 0 -#define MI_MODULE_NAME "MapInfo" +#define DEBUG_MI 0 +#define MI_MODULE_NAME "MapInfo" static int - iMapMaxDistance = 0, - iIsInEditMode[MAXPLAYERS + 1] = {0, ...}; + iMapMaxDistance = 0, + iIsInEditMode[MAXPLAYERS + 1] = {0, ...}; static bool - MapDataAvailable = false; + MapDataAvailable = false; static float - Start_Point[3] = {0.0, ...}, - End_Point[3] = {0.0, ...}, - Start_Dist = 0.0, - Start_Extra_Dist = 0.0, - End_Dist = 0.0, - fLocTemp[MAXPLAYERS + 1][3]; + Start_Point[3] = {0.0, ...}, + End_Point[3] = {0.0, ...}, + Start_Dist = 0.0, + Start_Extra_Dist = 0.0, + End_Dist = 0.0, + fLocTemp[MAXPLAYERS + 1][3]; static KeyValues - kMIData = null; + kMIData = null; void MI_APL() { - CreateNative("LGO_IsMapDataAvailable", _native_IsMapDataAvailable); - CreateNative("LGO_GetMapValueInt", _native_GetMapValueInt); - CreateNative("LGO_GetMapValueFloat", _native_GetMapValueFloat); - CreateNative("LGO_GetMapValueVector", _native_GetMapValueVector); - CreateNative("LGO_GetMapValueString", _native_GetMapValueString); - CreateNative("LGO_CopyMapSubsection", _native_CopyMapSubsection); + CreateNative("LGO_IsMapDataAvailable", _native_IsMapDataAvailable); + CreateNative("LGO_GetMapValueInt", _native_GetMapValueInt); + CreateNative("LGO_GetMapValueFloat", _native_GetMapValueFloat); + CreateNative("LGO_GetMapValueVector", _native_GetMapValueVector); + CreateNative("LGO_GetMapValueString", _native_GetMapValueString); + CreateNative("LGO_CopyMapSubsection", _native_CopyMapSubsection); } void MI_OnModuleStart() { - MI_KV_Load(); + MI_KV_Load(); - //RegAdminCmd("confogl_midata_reload", MI_KV_CmdReload, ADMFLAG_CONFIG); - RegAdminCmd("confogl_midata_save", MI_KV_CmdSave, ADMFLAG_CONFIG); - RegAdminCmd("confogl_save_location", MI_KV_CmdSaveLoc, ADMFLAG_CONFIG); + //RegAdminCmd("confogl_midata_reload", MI_KV_CmdReload, ADMFLAG_CONFIG); + RegAdminCmd("confogl_midata_save", MI_KV_CmdSave, ADMFLAG_CONFIG); + RegAdminCmd("confogl_save_location", MI_KV_CmdSaveLoc, ADMFLAG_CONFIG); - HookEvent("player_disconnect", PlayerDisconnect_Event); + HookEvent("player_disconnect", PlayerDisconnect_Event); } void MI_OnMapStart() { - MI_KV_UpdateMapInfo(); + MI_KV_UpdateMapInfo(); } void MI_OnMapEnd() { - kMIData.Rewind(); + kMIData.Rewind(); - MapDataAvailable = false; + MapDataAvailable = false; - // 0 - server index? - for (int i = 0; i <= MaxClients; i++) { - iIsInEditMode[i] = 0; - } + // 0 - server index? + for (int i = 0; i <= MaxClients; i++) { + iIsInEditMode[i] = 0; + } } void MI_OnModuleEnd() { - MI_KV_Close(); + MI_KV_Close(); } public void PlayerDisconnect_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - int client = GetClientOfUserId(hEvent.GetInt("userid")); - if (client > 0 && client <= MaxClients) { - iIsInEditMode[client] = 0; - } + int client = GetClientOfUserId(hEvent.GetInt("userid")); + if (client > 0 && client <= MaxClients) { + iIsInEditMode[client] = 0; + } } public Action MI_KV_CmdSave(int client, int args) { - char sCurMap[128]; - GetCurrentMap(sCurMap, sizeof(sCurMap)); + char sCurMap[128]; + GetCurrentMap(sCurMap, sizeof(sCurMap)); - if (kMIData.JumpToKey(sCurMap, true)) { - kMIData.SetVector("start_point", Start_Point); - kMIData.SetFloat("start_dist", Start_Dist); - kMIData.SetFloat("start_extra_dist", Start_Extra_Dist); + if (kMIData.JumpToKey(sCurMap, true)) { + kMIData.SetVector("start_point", Start_Point); + kMIData.SetFloat("start_dist", Start_Dist); + kMIData.SetFloat("start_extra_dist", Start_Extra_Dist); - char sNameBuff[PLATFORM_MAX_PATH]; - BuildConfigPath(sNameBuff, sizeof(sNameBuff), "mapinfo.txt"); + char sNameBuff[PLATFORM_MAX_PATH]; + BuildConfigPath(sNameBuff, sizeof(sNameBuff), "mapinfo.txt"); - kMIData.Rewind(); - kMIData.ExportToFile(sNameBuff); + kMIData.Rewind(); + kMIData.ExportToFile(sNameBuff); - ReplyToCommand(client, "%s has been added to %s.", sCurMap, sNameBuff); - } + ReplyToCommand(client, "%s has been added to %s.", sCurMap, sNameBuff); + } - return Plugin_Handled; + return Plugin_Handled; } public Action MI_KV_CmdSaveLoc(int client, int args) { - bool updateinfo = false; - char sCurMap[128]; - GetCurrentMap(sCurMap, sizeof(sCurMap)); + bool updateinfo = false; + char sCurMap[128]; + GetCurrentMap(sCurMap, sizeof(sCurMap)); - if (!iIsInEditMode[client]) { - if (!args) { - ReplyToCommand(client, "Move to the location of the medkits, then enter the point type (start_point or end_point)"); - return Plugin_Handled; - } + if (!iIsInEditMode[client]) { + if (!args) { + ReplyToCommand(client, "Move to the location of the medkits, then enter the point type (start_point or end_point)"); + return Plugin_Handled; + } - char sBuffer[16]; - GetCmdArg(1, sBuffer, sizeof(sBuffer)); + char sBuffer[16]; + GetCmdArg(1, sBuffer, sizeof(sBuffer)); - if (strcmp(sBuffer, "start_point", true) == 0) { - iIsInEditMode[client] = 1; - ReplyToCommand(client, "Move a few feet from the medkits and enter this command again to set the start_dist for this point"); - } else if (strcmp(sBuffer, "end_point", true) == 0) { - iIsInEditMode[client] = 2; - ReplyToCommand(client, "Move to the farthest point in the saferoom and enter this command again to set the end_dist for this point"); - } else { - ReplyToCommand(client, "Please enter the location type: start_point, end_point"); - return Plugin_Handled; - } + if (strcmp(sBuffer, "start_point", true) == 0) { + iIsInEditMode[client] = 1; + ReplyToCommand(client, "Move a few feet from the medkits and enter this command again to set the start_dist for this point"); + } else if (strcmp(sBuffer, "end_point", true) == 0) { + iIsInEditMode[client] = 2; + ReplyToCommand(client, "Move to the farthest point in the saferoom and enter this command again to set the end_dist for this point"); + } else { + ReplyToCommand(client, "Please enter the location type: start_point, end_point"); + return Plugin_Handled; + } - if (kMIData.JumpToKey(sCurMap, true)) { - GetClientAbsOrigin(client, fLocTemp[client]); - kMIData.SetVector(sBuffer, fLocTemp[client]); - } + if (kMIData.JumpToKey(sCurMap, true)) { + GetClientAbsOrigin(client, fLocTemp[client]); + kMIData.SetVector(sBuffer, fLocTemp[client]); + } - updateinfo = true; - } else if (iIsInEditMode[client] == 1) { - iIsInEditMode[client] = 3; + updateinfo = true; + } else if (iIsInEditMode[client] == 1) { + iIsInEditMode[client] = 3; - float fDistLoc[3], fDistance; - GetClientAbsOrigin(client, fDistLoc); + float fDistLoc[3], fDistance; + GetClientAbsOrigin(client, fDistLoc); - fDistance = GetVectorDistance(fDistLoc, fLocTemp[client]); - if (kMIData.JumpToKey(sCurMap, true)) { - kMIData.SetFloat("start_dist", fDistance); - } + fDistance = GetVectorDistance(fDistLoc, fLocTemp[client]); + if (kMIData.JumpToKey(sCurMap, true)) { + kMIData.SetFloat("start_dist", fDistance); + } - ReplyToCommand(client, "Move to the farthest point in the saferoom and enter this command again to set start_extra_dist for this point"); + ReplyToCommand(client, "Move to the farthest point in the saferoom and enter this command again to set start_extra_dist for this point"); - updateinfo = true; - } else if (iIsInEditMode[client] == 2) { - iIsInEditMode[client] = 0; + updateinfo = true; + } else if (iIsInEditMode[client] == 2) { + iIsInEditMode[client] = 0; - float fDistLoc[3], fDistance; - GetClientAbsOrigin(client, fDistLoc); + float fDistLoc[3], fDistance; + GetClientAbsOrigin(client, fDistLoc); - fDistance = GetVectorDistance(fDistLoc, fLocTemp[client]); - if (kMIData.JumpToKey(sCurMap, true)) { - kMIData.SetFloat("end_dist", fDistance); - } + fDistance = GetVectorDistance(fDistLoc, fLocTemp[client]); + if (kMIData.JumpToKey(sCurMap, true)) { + kMIData.SetFloat("end_dist", fDistance); + } - updateinfo = true; - } else if (iIsInEditMode[client] == 3) { - iIsInEditMode[client] = 0; + updateinfo = true; + } else if (iIsInEditMode[client] == 3) { + iIsInEditMode[client] = 0; - float fDistLoc[3], fDistance; - GetClientAbsOrigin(client, fDistLoc); + float fDistLoc[3], fDistance; + GetClientAbsOrigin(client, fDistLoc); - fDistance = GetVectorDistance(fDistLoc, fLocTemp[client]); - if (kMIData.JumpToKey(sCurMap, true)) { - kMIData.SetFloat("start_extra_dist", fDistance); - } + fDistance = GetVectorDistance(fDistLoc, fLocTemp[client]); + if (kMIData.JumpToKey(sCurMap, true)) { + kMIData.SetFloat("start_extra_dist", fDistance); + } - updateinfo = true; - } + updateinfo = true; + } - if (updateinfo) { - char sNameBuff[PLATFORM_MAX_PATH]; - BuildConfigPath(sNameBuff, sizeof(sNameBuff), "mapinfo.txt"); + if (updateinfo) { + char sNameBuff[PLATFORM_MAX_PATH]; + BuildConfigPath(sNameBuff, sizeof(sNameBuff), "mapinfo.txt"); - kMIData.Rewind(); - kMIData.ExportToFile(sNameBuff); + kMIData.Rewind(); + kMIData.ExportToFile(sNameBuff); - ReplyToCommand(client, "mapinfo.txt has been updated!"); - } + ReplyToCommand(client, "mapinfo.txt has been updated!"); + } - return Plugin_Handled; + return Plugin_Handled; } static void MI_KV_Close() { - if (kMIData != null) { - delete kMIData; - kMIData = null; - } + if (kMIData != null) { + delete kMIData; + kMIData = null; + } } static void MI_KV_Load() { - char sNameBuff[PLATFORM_MAX_PATH]; + char sNameBuff[PLATFORM_MAX_PATH]; - if (DEBUG_MI || IsDebugEnabled()) { - LogMessage("[%s] Loading MapInfo KeyValues", MI_MODULE_NAME); - } + if (DEBUG_MI || IsDebugEnabled()) { + LogMessage("[%s] Loading MapInfo KeyValues", MI_MODULE_NAME); + } - kMIData = new KeyValues("MapInfo"); - BuildConfigPath(sNameBuff, sizeof(sNameBuff), "mapinfo.txt"); //Build our filepath - if (!kMIData.ImportFromFile(sNameBuff)) { - Debug_LogError(MI_MODULE_NAME, "Couldn't load MapInfo data!"); - MI_KV_Close(); - return; - } + kMIData = new KeyValues("MapInfo"); + BuildConfigPath(sNameBuff, sizeof(sNameBuff), "mapinfo.txt"); //Build our filepath + if (!kMIData.ImportFromFile(sNameBuff)) { + Debug_LogError(MI_MODULE_NAME, "Couldn't load MapInfo data!"); + MI_KV_Close(); + return; + } } static void MI_KV_UpdateMapInfo() { - char sCurMap[128]; - GetCurrentMap(sCurMap, sizeof(sCurMap)); + char sCurMap[128]; + GetCurrentMap(sCurMap, sizeof(sCurMap)); - if (kMIData.JumpToKey(sCurMap)) { - kMIData.GetVector("start_point", Start_Point); - kMIData.GetVector("end_point", End_Point); + if (kMIData.JumpToKey(sCurMap)) { + kMIData.GetVector("start_point", Start_Point); + kMIData.GetVector("end_point", End_Point); - Start_Dist = kMIData.GetFloat("start_dist"); - Start_Extra_Dist = kMIData.GetFloat("start_extra_dist"); - End_Dist = kMIData.GetFloat("end_dist"); + Start_Dist = kMIData.GetFloat("start_dist"); + Start_Extra_Dist = kMIData.GetFloat("start_extra_dist"); + End_Dist = kMIData.GetFloat("end_dist"); - iMapMaxDistance = kMIData.GetNum("max_distance", -1); + iMapMaxDistance = kMIData.GetNum("max_distance", -1); - // kMIData.Rewind(); - MapDataAvailable = true; - } else { - MapDataAvailable = false; - Start_Dist = FindStartPointHeuristic(Start_Point); - if (Start_Dist > 0.0) { - // This is the largest Start Extra Dist we've encountered; - // May be too much - Start_Extra_Dist = 500.0; - } else { - ZeroVector(Start_Point); - Start_Dist = -1.0; - Start_Extra_Dist = -1.0; - } + // kMIData.Rewind(); + MapDataAvailable = true; + } else { + MapDataAvailable = false; + Start_Dist = FindStartPointHeuristic(Start_Point); + if (Start_Dist > 0.0) { + // This is the largest Start Extra Dist we've encountered; + // May be too much + Start_Extra_Dist = 500.0; + } else { + ZeroVector(Start_Point); + Start_Dist = -1.0; + Start_Extra_Dist = -1.0; + } - ZeroVector(End_Point); - End_Dist = -1.0; - iMapMaxDistance = -1; - LogMessage("[%s] MapInfo for %s is missing.", MI_MODULE_NAME, sCurMap); - } + ZeroVector(End_Point); + End_Dist = -1.0; + iMapMaxDistance = -1; + LogMessage("[%s] MapInfo for %s is missing.", MI_MODULE_NAME, sCurMap); + } - // Let's leave MIData on the current map - // kMIData.Rewind(); + // Let's leave MIData on the current map + // kMIData.Rewind(); } static float FindStartPointHeuristic(float result[3]) { - char entclass[MAX_ENTITY_NAME_LENGTH]; - float kitOrigin[4][3], averageOrigin[3]; - int kits = 0, entcount = GetEntityCount(); + char entclass[MAX_ENTITY_NAME_LENGTH]; + float kitOrigin[4][3], averageOrigin[3]; + int kits = 0, entcount = GetEntityCount(); - for (int iEntity = (MaxClients + 1); iEntity <= entcount && kits < 4; iEntity++) { - if (!IsValidEdict(iEntity)) { - continue; - } + for (int iEntity = (MaxClients + 1); iEntity <= entcount && kits < 4; iEntity++) { + if (!IsValidEdict(iEntity)) { + continue; + } - GetEdictClassname(iEntity, entclass, sizeof(entclass)); - if (strcmp(entclass, "weapon_first_aid_kit_spawn") == 0) { - GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", kitOrigin[kits]); - AddToVector(averageOrigin, kitOrigin[kits]); - kits++; - } - } + GetEdictClassname(iEntity, entclass, sizeof(entclass)); + if (strcmp(entclass, "weapon_first_aid_kit_spawn") == 0) { + GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", kitOrigin[kits]); + AddToVector(averageOrigin, kitOrigin[kits]); + kits++; + } + } - if (kits < 4) { - return -1.0; - } + if (kits < 4) { + return -1.0; + } - ScaleVector(averageOrigin, 0.25); + ScaleVector(averageOrigin, 0.25); - float greatestDist, tempDist; - for (int i = 0; i < 4; i++) { - tempDist = GetVectorDistance(averageOrigin, kitOrigin[i]); + float greatestDist, tempDist; + for (int i = 0; i < 4; i++) { + tempDist = GetVectorDistance(averageOrigin, kitOrigin[i]); - if (tempDist > greatestDist) { - greatestDist = tempDist; - } - } + if (tempDist > greatestDist) { + greatestDist = tempDist; + } + } - CopyVector(result, averageOrigin); - return (greatestDist + 1.0); + CopyVector(result, averageOrigin); + return (greatestDist + 1.0); } // Old Functions (Avoid using these, use the ones below) stock float GetMapStartOriginX() { - return Start_Point[0]; + return Start_Point[0]; } stock float GetMapStartOriginY() { - return Start_Point[1]; + return Start_Point[1]; } stock float GetMapStartOriginZ() { - return Start_Point[2]; + return Start_Point[2]; } stock float GetMapEndOriginX() { - return End_Point[0]; + return End_Point[0]; } stock float GetMapEndOriginY() { - return End_Point[1]; + return End_Point[1]; } stock float GetMapEndOriginZ() { - return End_Point[2]; + return End_Point[2]; } // New Super Awesome Functions!!! stock int GetCustomMapMaxScore() { - return iMapMaxDistance; + return iMapMaxDistance; } stock bool IsMapDataAvailable() { - return MapDataAvailable; + return MapDataAvailable; } /** * Determines if an entity is in a start or end saferoom (based on mapinfo.txt or automatically generated info) * - * @param ent The entity to be checked - * @param saferoom START_SAFEROOM (1) = Start saferoom, END_SAFEROOM (2) = End saferoom (including finale area), 3 = both - * @return True if it is one of the specified saferoom(s) - * False if it is not in the specified saferoom(s) - * False if no saferoom specified + * @param ent The entity to be checked + * @param saferoom START_SAFEROOM (1) = Start saferoom, END_SAFEROOM (2) = End saferoom (including finale area), 3 = both + * @return True if it is one of the specified saferoom(s) + * False if it is not in the specified saferoom(s) + * False if no saferoom specified */ stock bool IsEntityInSaferoom(int ent, int saferoom = 3) //ItemTracking (commented out) { - float origins[3]; - GetEntPropVector(ent, Prop_Send, "m_vecOrigin", origins); + float origins[3]; + GetEntPropVector(ent, Prop_Send, "m_vecOrigin", origins); - if ((saferoom & START_SAFEROOM) - && (GetVectorDistance(origins, Start_Point) <= ((Start_Extra_Dist > Start_Dist) ? Start_Extra_Dist : Start_Dist)) - ) { - return true; - } else if ((saferoom & END_SAFEROOM) && (GetVectorDistance(origins, End_Point) <= End_Dist)) { - return true; - } else { - return false; - } + if ((saferoom & START_SAFEROOM) + && (GetVectorDistance(origins, Start_Point) <= ((Start_Extra_Dist > Start_Dist) ? Start_Extra_Dist : Start_Dist)) + ) { + return true; + } else if ((saferoom & END_SAFEROOM) && (GetVectorDistance(origins, End_Point) <= End_Dist)) { + return true; + } else { + return false; + } -// return ((GetVectorDistance(origins, Start_Point) <= ((Start_Extra_Dist > Start_Dist) ? Start_Extra_Dist : Start_Dist)) -// || (GetVectorDistance(origins, End_Point) <= End_Dist)); +// return ((GetVectorDistance(origins, Start_Point) <= ((Start_Extra_Dist > Start_Dist) ? Start_Extra_Dist : Start_Dist)) +// || (GetVectorDistance(origins, End_Point) <= End_Dist)); } stock int GetMapValueInt(const char[] key, int defvalue = 0) //BossSpawning { - return kMIData.GetNum(key, defvalue); + return kMIData.GetNum(key, defvalue); } stock float GetMapValueFloat(const char[] key, float defvalue = 0.0) //BossSpawning { - return kMIData.GetFloat(key, defvalue); + return kMIData.GetFloat(key, defvalue); } stock void GetMapValueVector(const char[] key, float vector[3], float defvalue[3] = NULL_VECTOR) //BossSpawning { - kMIData.GetVector(key, vector, defvalue); + kMIData.GetVector(key, vector, defvalue); } stock void GetMapValueString(const char[] key, char[] value, const int maxlength, const char[] defvalue) { - kMIData.GetString(key, value, maxlength, defvalue); + kMIData.GetString(key, value, maxlength, defvalue); } stock void CopyMapSubsection(KeyValues kv, const char[] section) //ItemTracking { - if (kMIData.JumpToKey(section, false)) { - kv.Import(kMIData); // KvCopySubkeys(kMIData, kv); - kMIData.GoBack(); - } + if (kMIData.JumpToKey(section, false)) { + kv.Import(kMIData); // KvCopySubkeys(kMIData, kv); + kMIData.GoBack(); + } } stock void GetMapStartOrigin(float origin[3]) //not used { - origin[0] = Start_Point[0]; - origin[1] = Start_Point[1]; - origin[2] = Start_Point[2]; + origin[0] = Start_Point[0]; + origin[1] = Start_Point[1]; + origin[2] = Start_Point[2]; } stock void GetMapEndOrigin(float origin[3]) //not used { - origin[0] = End_Point[0]; - origin[1] = End_Point[1]; - origin[2] = End_Point[2]; + origin[0] = End_Point[0]; + origin[1] = End_Point[1]; + origin[2] = End_Point[2]; } stock float GetMapEndDist() //WeaponInformation use it { - return End_Dist; + return End_Dist; } stock float GetMapStartDist() //WeaponInformation use it { - return Start_Dist; + return Start_Dist; } stock float GetMapStartExtraDist() //WeaponInformation use it { - return Start_Extra_Dist; + return Start_Extra_Dist; } // Natives public int _native_IsMapDataAvailable(Handle plugin, int numParams) { - return IsMapDataAvailable(); + return IsMapDataAvailable(); } public int _native_GetMapValueInt(Handle plugin, int numParams) { - int iLen = 0; - GetNativeStringLength(1, iLen); + int iLen = 0; + GetNativeStringLength(1, iLen); - int iNewLen = iLen + 1; - char[] sKey = new char[iNewLen]; - GetNativeString(1, sKey, iNewLen); + int iNewLen = iLen + 1; + char[] sKey = new char[iNewLen]; + GetNativeString(1, sKey, iNewLen); - int iDefVal = GetNativeCell(2); - return GetMapValueInt(sKey, iDefVal); + int iDefVal = GetNativeCell(2); + return GetMapValueInt(sKey, iDefVal); } #if SOURCEMOD_V_MINOR > 9 @@ -437,75 +437,75 @@ public any _native_GetMapValueFloat(Handle plugin, int numParams) public int _native_GetMapValueFloat(Handle plugin, int numParams) #endif { - int iLen = 0; - GetNativeStringLength(1, iLen); + int iLen = 0; + GetNativeStringLength(1, iLen); - int iNewLen = iLen + 1; - char[] sKey = new char[iNewLen]; - GetNativeString(1, sKey, iNewLen); + int iNewLen = iLen + 1; + char[] sKey = new char[iNewLen]; + GetNativeString(1, sKey, iNewLen); - float iDefVal = GetNativeCell(2); + float iDefVal = GetNativeCell(2); #if SOURCEMOD_V_MINOR > 9 - return GetMapValueFloat(sKey, iDefVal); + return GetMapValueFloat(sKey, iDefVal); #else - return view_as(GetMapValueFloat(sKey, iDefVal)); + return view_as(GetMapValueFloat(sKey, iDefVal)); #endif } public int _native_GetMapValueVector(Handle plugin, int numParams) { - int iLen = 0; - GetNativeStringLength(1, iLen); + int iLen = 0; + GetNativeStringLength(1, iLen); - int iNewLen = iLen + 1; - char[] sKey = new char[iNewLen]; - GetNativeString(1, sKey, iNewLen); + int iNewLen = iLen + 1; + char[] sKey = new char[iNewLen]; + GetNativeString(1, sKey, iNewLen); - float fDefVal[3], fValue[3]; - GetNativeArray(3, fDefVal, sizeof(fDefVal)); - GetMapValueVector(sKey, fValue, fDefVal); + float fDefVal[3], fValue[3]; + GetNativeArray(3, fDefVal, sizeof(fDefVal)); + GetMapValueVector(sKey, fValue, fDefVal); - SetNativeArray(2, fValue, sizeof(fValue)); - return 1; + SetNativeArray(2, fValue, sizeof(fValue)); + return 1; } public int _native_GetMapValueString(Handle plugin, int numParams) { - int iLen = 0; - GetNativeStringLength(1, iLen); + int iLen = 0; + GetNativeStringLength(1, iLen); - int iNewLen = iLen + 1; - char[] sKey = new char[iNewLen]; - GetNativeString(1, sKey, iNewLen); + int iNewLen = iLen + 1; + char[] sKey = new char[iNewLen]; + GetNativeString(1, sKey, iNewLen); - GetNativeStringLength(4, iLen); + GetNativeStringLength(4, iLen); - iNewLen = iLen + 1; - char[] sDefVal = new char[iNewLen]; - GetNativeString(4, sDefVal, iNewLen); + iNewLen = iLen + 1; + char[] sDefVal = new char[iNewLen]; + GetNativeString(4, sDefVal, iNewLen); - iLen = GetNativeCell(3); + iLen = GetNativeCell(3); - iNewLen = iLen + 1; - char[] sBuf = new char[iNewLen]; - GetMapValueString(sKey, sBuf, iNewLen, sDefVal); + iNewLen = iLen + 1; + char[] sBuf = new char[iNewLen]; + GetMapValueString(sKey, sBuf, iNewLen, sDefVal); - SetNativeString(2, sBuf, iNewLen); - return 1; + SetNativeString(2, sBuf, iNewLen); + return 1; } public int _native_CopyMapSubsection(Handle plugin, int numParams) { - int iLen = 0; - GetNativeStringLength(2, iLen); + int iLen = 0; + GetNativeStringLength(2, iLen); - int iNewLen = iLen + 1; - char[] sKey = new char[iNewLen]; - GetNativeString(2, sKey, iNewLen); + int iNewLen = iLen + 1; + char[] sKey = new char[iNewLen]; + GetNativeString(2, sKey, iNewLen); - KeyValues hKv = GetNativeCell(1); - CopyMapSubsection(hKv, sKey); + KeyValues hKv = GetNativeCell(1); + CopyMapSubsection(hKv, sKey); - return 1; + return 1; } diff --git a/addons/sourcemod/scripting/confoglcompmod/PasswordSystem.sp b/addons/sourcemod/scripting/confoglcompmod/PasswordSystem.sp index 8ab847d3e..99d2d9c1b 100644 --- a/addons/sourcemod/scripting/confoglcompmod/PasswordSystem.sp +++ b/addons/sourcemod/scripting/confoglcompmod/PasswordSystem.sp @@ -1,166 +1,166 @@ #if defined __password_system_included - #endinput + #endinput #endif #define __password_system_included -#define PS_MODULE_NAME "PasswordSystem" +#define PS_MODULE_NAME "PasswordSystem" static char - PS_sPassword[128] = "\0"; + PS_sPassword[128] = "\0"; static bool - PS_bIsPassworded = false, - PS_bSuppress = false; + PS_bIsPassworded = false, + PS_bSuppress = false; static ConVar - PS_hReloaded = null, - PS_hPassword = null; + PS_hReloaded = null, + PS_hPassword = null; void PS_OnModuleStart() { - PS_hPassword = CreateConVarEx( \ - "password", \ - "", \ - "Set a password on the server, if empty password disabled. See Confogl's wiki for more information", \ - FCVAR_DONTRECORD|FCVAR_PROTECTED \ - ); - - PS_hReloaded = FindConVarEx("password_reloaded"); - - if (PS_hReloaded == null) { - PS_hReloaded = CreateConVarEx( \ - "password_reloaded", \ - "", \ - "DONT TOUCH THIS CVAR! This will is to make sure that the password gets set upon the plugin is reloaded", \ - FCVAR_DONTRECORD|FCVAR_UNLOGGED \ - ); - } else { - char sBuffer[128]; - PS_hReloaded.GetString(sBuffer, sizeof(sBuffer)); - - PS_hPassword.SetString(sBuffer); - PS_hReloaded.SetString(""); - - PS_hPassword.GetString(PS_sPassword, sizeof(PS_sPassword)); - - PS_bIsPassworded = true; - PS_SetPasswordOnClients(); - } - - PS_hPassword.AddChangeHook(PS_ConVarChange); - - HookEvent("player_disconnect", PS_SuppressDisconnectMsg, EventHookMode_Pre); + PS_hPassword = CreateConVarEx( \ + "password", \ + "", \ + "Set a password on the server, if empty password disabled. See Confogl's wiki for more information", \ + FCVAR_DONTRECORD|FCVAR_PROTECTED \ + ); + + PS_hReloaded = FindConVarEx("password_reloaded"); + + if (PS_hReloaded == null) { + PS_hReloaded = CreateConVarEx( \ + "password_reloaded", \ + "", \ + "DONT TOUCH THIS CVAR! This will is to make sure that the password gets set upon the plugin is reloaded", \ + FCVAR_DONTRECORD|FCVAR_UNLOGGED \ + ); + } else { + char sBuffer[128]; + PS_hReloaded.GetString(sBuffer, sizeof(sBuffer)); + + PS_hPassword.SetString(sBuffer); + PS_hReloaded.SetString(""); + + PS_hPassword.GetString(PS_sPassword, sizeof(PS_sPassword)); + + PS_bIsPassworded = true; + PS_SetPasswordOnClients(); + } + + PS_hPassword.AddChangeHook(PS_ConVarChange); + + HookEvent("player_disconnect", PS_SuppressDisconnectMsg, EventHookMode_Pre); } void PS_OnModuleEnd() { - if (!PS_bIsPassworded) { - return; - } + if (!PS_bIsPassworded) { + return; + } - PS_hReloaded.SetString(PS_sPassword); + PS_hReloaded.SetString(PS_sPassword); } static void PS_CheckPassword(int client) { - if (!PS_bIsPassworded || !IsPluginEnabled() || IsFakeClient(client)) { - return; - } + if (!PS_bIsPassworded || !IsPluginEnabled() || IsFakeClient(client)) { + return; + } - CreateTimer(0.1, PS_CheckPassword_Timer, GetClientUserId(client), TIMER_REPEAT); + CreateTimer(0.1, PS_CheckPassword_Timer, GetClientUserId(client), TIMER_REPEAT); } public Action PS_CheckPassword_Timer(Handle hTimer, int userid) { - int client = GetClientOfUserId(userid); + int client = GetClientOfUserId(userid); - if (client < 1) { - return Plugin_Stop; - } + if (client < 1) { + return Plugin_Stop; + } - if (!IsClientInGame(client)) { - return Plugin_Continue; - } + if (!IsClientInGame(client)) { + return Plugin_Continue; + } - QueryClientConVar(client, "sv_password", PS_ConVarDone, userid); + QueryClientConVar(client, "sv_password", PS_ConVarDone, userid); - return Plugin_Stop; + return Plugin_Stop; } public void PS_ConVarDone(QueryCookie cookie, int client, ConVarQueryResult result, const char[] cvarName, const char[] cvarValue, int userid) { - if (result == ConVarQuery_Okay) { - char buffer[128]; - PS_hPassword.GetString(buffer, sizeof(buffer)); + if (result == ConVarQuery_Okay) { + char buffer[128]; + PS_hPassword.GetString(buffer, sizeof(buffer)); - if (strcmp(buffer, cvarValue) == 0) { - return; - } - } + if (strcmp(buffer, cvarValue) == 0) { + return; + } + } - if (client == GetClientOfUserId(userid) && IsClientConnected(client)) { - PS_bSuppress = true; + if (client == GetClientOfUserId(userid) && IsClientConnected(client)) { + PS_bSuppress = true; - KickClient(client, "Bad password"); - } + KickClient(client, "Bad password"); + } } public void PS_ConVarChange(ConVar convar, const char[] oldValue, const char[] newValue) { - PS_hPassword.GetString(PS_sPassword, sizeof(PS_sPassword)); - - if (strlen(PS_sPassword) > 0) { - PS_bIsPassworded = true; - PS_SetPasswordOnClients(); - } else { - PS_bIsPassworded = false; - } + PS_hPassword.GetString(PS_sPassword, sizeof(PS_sPassword)); + + if (strlen(PS_sPassword) > 0) { + PS_bIsPassworded = true; + PS_SetPasswordOnClients(); + } else { + PS_bIsPassworded = false; + } } public Action PS_SuppressDisconnectMsg(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (bDontBroadcast || !PS_bSuppress) { - return Plugin_Continue; - } + if (bDontBroadcast || !PS_bSuppress) { + return Plugin_Continue; + } - char clientName[33], networkID[22], reason[65]; - hEvent.GetString("name", clientName, sizeof(clientName)); - hEvent.GetString("networkid", networkID, sizeof(networkID)); - hEvent.GetString("reason", reason, sizeof(reason)); + char clientName[33], networkID[22], reason[65]; + hEvent.GetString("name", clientName, sizeof(clientName)); + hEvent.GetString("networkid", networkID, sizeof(networkID)); + hEvent.GetString("reason", reason, sizeof(reason)); - Handle newEvent = CreateEvent("player_disconnect", true); - SetEventInt(newEvent, "userid", hEvent.GetInt("userid")); - SetEventString(newEvent, "reason", reason); - SetEventString(newEvent, "name", clientName); - SetEventString(newEvent, "networkid", networkID); - FireEvent(newEvent, true); + Handle newEvent = CreateEvent("player_disconnect", true); + SetEventInt(newEvent, "userid", hEvent.GetInt("userid")); + SetEventString(newEvent, "reason", reason); + SetEventString(newEvent, "name", clientName); + SetEventString(newEvent, "networkid", networkID); + FireEvent(newEvent, true); - PS_bSuppress = false; + PS_bSuppress = false; - return Plugin_Handled; + return Plugin_Handled; } void PS_OnMapEnd() { - PS_SetPasswordOnClients(); + PS_SetPasswordOnClients(); } void PS_OnClientPutInServer(int client) { - PS_CheckPassword(client); + PS_CheckPassword(client); } static void PS_SetPasswordOnClients() { - char pwbuffer[128]; - PS_hPassword.GetString(pwbuffer, sizeof(pwbuffer)); + char pwbuffer[128]; + PS_hPassword.GetString(pwbuffer, sizeof(pwbuffer)); - for (int client = 1; client <= MaxClients; client++) { - if (!IsClientInGame(client) || IsFakeClient(client)){ - continue; - } + for (int client = 1; client <= MaxClients; client++) { + if (!IsClientInGame(client) || IsFakeClient(client)){ + continue; + } - LogMessage("[%s] Set password on %N, password %s", PS_MODULE_NAME, client, pwbuffer); - ClientCommand(client, "sv_password \"%s\"", pwbuffer); - } + LogMessage("[%s] Set password on %N, password %s", PS_MODULE_NAME, client, pwbuffer); + ClientCommand(client, "sv_password \"%s\"", pwbuffer); + } } diff --git a/addons/sourcemod/scripting/confoglcompmod/ReqMatch.sp b/addons/sourcemod/scripting/confoglcompmod/ReqMatch.sp index 234466bc8..b2e017d1e 100644 --- a/addons/sourcemod/scripting/confoglcompmod/ReqMatch.sp +++ b/addons/sourcemod/scripting/confoglcompmod/ReqMatch.sp @@ -1,604 +1,661 @@ #if defined __reg_match_included - #endinput + #endinput #endif #define __reg_match_included -#define RM_DEBUG 0 +#define RM_DEBUG 0 #define RM_MODULE_NAME "ReqMatch" #define MAPRESTARTTIME 3.0 #define RESETMINTIME 60.0 static bool - // RM_bMatchRequest[2] = {false, ...}, - RM_bIsMatchModeLoaded = false, - RM_bIsAMatchActive = false, - RM_bIsPluginsLoaded = false, - RM_bIsMapRestarted = false; - RM_bIsChangeLevelAvailable = false; - RM_bIsChmatchRequest = false; + // RM_bMatchRequest[2] = {false, ...}, + RM_bIsMatchModeLoaded = false, + RM_bIsAMatchActive = false, + RM_bIsPluginsLoaded = false, + RM_bIsMapRestarted = false; + RM_bIsChangeLevelAvailable = false; + // RM_bIsChmatchRequest = false; static Handle - RM_hFwdMatchLoad = null, - RM_hFwdMatchUnload = null; + RM_hFwdMatchLoad = null, + RM_hFwdMatchUnload = null; static ConVar - RM_hSbAllBotGame = null, - RM_hDoRestart = null, - // RM_hAllowVoting = null, - RM_hReloaded = null, - RM_hChangeMap = null, - RM_hAutoLoad = null, - RM_hAutoCfg = null, - RM_hConfigFile_On = null, - RM_hConfigFile_Plugins = null, - RM_hConfigFile_Off = null; + RM_hSbAllBotGame = null, + RM_hDoRestart = null, + // RM_hAllowVoting = null, + RM_hReloaded = null, + RM_hUnloaded = null, + RM_hChangeMap = null, + RM_hAutoLoad = null, + RM_hAutoCfg = null, + RM_hConfigFile_On = null, + RM_hConfigFile_Plugins = null, + RM_hConfigFile_Off = null, + RM_hMatchName = null; void RM_APL() { - RM_hFwdMatchLoad = CreateGlobalForward("LGO_OnMatchModeLoaded", ET_Ignore); - RM_hFwdMatchUnload = CreateGlobalForward("LGO_OnMatchModeUnloaded", ET_Ignore); + RM_hFwdMatchLoad = CreateGlobalForward("LGO_OnMatchModeLoaded", ET_Ignore); + RM_hFwdMatchUnload = CreateGlobalForward("LGO_OnMatchModeUnloaded", ET_Ignore); - CreateNative("LGO_IsMatchModeLoaded", native_IsMatchModeLoaded); + CreateNative("LGO_IsMatchModeLoaded", native_IsMatchModeLoaded); } public void OnLibraryAdded(const char[] name) { - if (strcmp(name, "l4d2_changelevel") == 0) - { - RM_bIsChangeLevelAvailable = true; - } + if (strcmp(name, "l4d2_changelevel") == 0) + { + RM_bIsChangeLevelAvailable = true; + } } public void OnLibraryRemoved(const char[] name) { - if (strcmp(name, "l4d2_changelevel") == 0) - { - RM_bIsChangeLevelAvailable = false; - } + if (strcmp(name, "l4d2_changelevel") == 0) + { + RM_bIsChangeLevelAvailable = false; + } } void RM_OnModuleStart() { - RM_hDoRestart = CreateConVarEx("match_restart", "1", "Sets whether the plugin will restart the map upon match mode being forced or requested", _, true, 0.0, true, 1.0); - // RM_hAllowVoting = CreateConVarEx("match_allowvoting", "1", "Sets whether players can vote/request for match mode", _, true, 0.0, true, 1.0); - RM_hAutoLoad = CreateConVarEx("match_autoload", "0", "Has match mode start up automatically when a player connects and the server is not in match mode", _, true, 0.0, true, 1.0); - RM_hAutoCfg = CreateConVarEx("match_autoconfig", "", "Specify which config to load if the autoloader is enabled"); - RM_hConfigFile_On = CreateConVarEx("match_execcfg_on", "confogl.cfg", "Execute this config file upon match mode starts and every map after that."); - // RM_hConfigFile_Plugins = CreateConVarEx("match_execcfg_plugins", "confogl_plugins.cfg", "Execute this config file upon match mode starts. This will only get executed once and meant for plugins that needs to be loaded."); //original - RM_hConfigFile_Plugins = CreateConVarEx("match_execcfg_plugins", "generalfixes.cfg;confogl_plugins.cfg;sharedplugins.cfg", "Execute this config file upon match mode starts. This will only get executed once and meant for plugins that needs to be loaded."); // rework - RM_hConfigFile_Off = CreateConVarEx("match_execcfg_off", "confogl_off.cfg", "Execute this config file upon match mode ends."); - - // RegConsoleCmd("sm_match", RM_Cmd_Match); - RegAdminCmd("sm_forcematch", RM_Cmd_ForceMatch, ADMFLAG_CONFIG, "Forces the game to use match mode"); - RegAdminCmd("sm_fm", RM_Cmd_ForceMatch, ADMFLAG_CONFIG, "Forces the game to use match mode"); - RegAdminCmd("sm_resetmatch", RM_Cmd_ResetMatch, ADMFLAG_CONFIG, "Forces match mode to turn off REGRADLESS for always on or forced match"); - RegAdminCmd("sm_forcechangematch", RM_CMD_ChangeMatch, ADMFLAG_CONFIG, "Forces the match to be changed"); - RegAdminCmd("sm_fchmatch", RM_CMD_ChangeMatch, ADMFLAG_CONFIG, "Forces the match to be changed"); - - RM_hSbAllBotGame = FindConVar("sb_all_bot_game"); - - RM_hReloaded = FindConVarEx("match_reloaded"); - if (RM_hReloaded == null) - { - RM_hReloaded = CreateConVarEx("match_reloaded", "0", "DONT TOUCH THIS CVAR! This is to prevent match feature keep looping, however the plugin takes care of it. Don't change it!", FCVAR_DONTRECORD | FCVAR_UNLOGGED); - } - - RM_hChangeMap = FindConVarEx("match_map"); - if (RM_hChangeMap == null) - { - RM_hChangeMap = CreateConVarEx("match_map", "", "DONT TOUCH THIS CVAR! This is to store the map that we'll be changing to", FCVAR_DONTRECORD | FCVAR_UNLOGGED); - } - - if (RM_hReloaded.BoolValue) - { - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Plugin was reloaded from match mode, executing match load", RM_MODULE_NAME); - } - - RM_bIsPluginsLoaded = true; - RM_hReloaded.SetInt(0); - RM_Match_Load(); - } - - // ChangeLevel - if (LibraryExists("l4d2_changelevel")) - { - RM_bIsChangeLevelAvailable = true; - } + RM_hDoRestart = CreateConVarEx("match_restart", "1", "Sets whether the plugin will restart the map upon match mode being forced or requested", _, true, 0.0, true, 1.0); + // RM_hAllowVoting = CreateConVarEx("match_allowvoting", "1", "Sets whether players can vote/request for match mode", _, true, 0.0, true, 1.0); + RM_hAutoLoad = CreateConVarEx("match_autoload", "0", "Has match mode start up automatically when a player connects and the server is not in match mode", _, true, 0.0, true, 1.0); + RM_hAutoCfg = CreateConVarEx("match_autoconfig", "", "Specify which config to load if the autoloader is enabled"); + RM_hConfigFile_On = CreateConVarEx("match_execcfg_on", "confogl.cfg", "Execute this config file upon match mode starts and every map after that."); + RM_hConfigFile_Plugins = CreateConVarEx("match_execcfg_plugins", "confogl_plugins.cfg", "Execute this config file upon match mode starts. This will only get executed once and meant for plugins that needs to be loaded."); //original + // RM_hConfigFile_Plugins = CreateConVarEx("match_execcfg_plugins", "generalfixes.cfg;confogl_plugins.cfg;sharedplugins.cfg", "Execute this config file upon match mode starts. This will only get executed once and meant for plugins that needs to be loaded."); // rework + RM_hConfigFile_Off = CreateConVarEx("match_execcfg_off", "confogl_off.cfg", "Execute this config file upon match mode ends."); + + // RegConsoleCmd("sm_match", RM_Cmd_Match); + RegAdminCmd("sm_forcematch", RM_Cmd_ForceMatch, ADMFLAG_CONFIG, "Forces the game to use match mode"); + RegAdminCmd("sm_fm", RM_Cmd_ForceMatch, ADMFLAG_CONFIG, "Forces the game to use match mode"); + RegAdminCmd("sm_resetmatch", RM_Cmd_ResetMatch, ADMFLAG_CONFIG, "Forces match mode to turn off REGRADLESS for always on or forced match"); + // RegAdminCmd("sm_forcechangematch", RM_CMD_ChangeMatch, ADMFLAG_CONFIG, "Forces the match to be changed"); + // RegAdminCmd("sm_fchmatch", RM_CMD_ChangeMatch, ADMFLAG_CONFIG, "Forces the match to be changed"); + + RM_hSbAllBotGame = FindConVar("sb_all_bot_game"); + + RM_hReloaded = FindConVarEx("match_reloaded"); + if (RM_hReloaded == null) + { + RM_hReloaded = CreateConVarEx("match_reloaded", "0", "DONT TOUCH THIS CVAR! This is to prevent match feature keep looping, however the plugin takes care of it. Don't change it!", FCVAR_DONTRECORD | FCVAR_UNLOGGED); + } + + RM_hChangeMap = FindConVarEx("match_map"); + if (RM_hChangeMap == null) + { + RM_hChangeMap = CreateConVarEx("match_map", "", "DONT TOUCH THIS CVAR! This is to store the map that we'll be changing to", FCVAR_DONTRECORD | FCVAR_UNLOGGED); + } + + if (RM_hReloaded.BoolValue) + { + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Plugin was reloaded from match mode, executing match load", RM_MODULE_NAME); + } + + RM_bIsPluginsLoaded = true; + RM_hReloaded.BoolValue = false; + RM_Match_Load(); + } + + RM_hUnloaded = FindConVarEx("match_unloaded"); + if (RM_hUnloaded == null) + { + RM_hUnloaded = CreateConVarEx("match_unloaded", "0", "DONT TOUCH THIS CVAR! This is to prevent match feature keep looping, however the plugin takes care of it. Don't change it!", FCVAR_DONTRECORD | FCVAR_UNLOGGED); + } + + if (RM_hUnloaded.BoolValue) + { + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Plugin was reloaded from resetting match mode, executing match unload", RM_MODULE_NAME); + } + + if (!RM_bIsMapRestarted && RM_hDoRestart.BoolValue) + { + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Restarting map!"); + char sMap[PLATFORM_MAX_PATH]; + GetCurrentMap(sMap, sizeof(sMap)); + + DataPack hDp; + CreateDataTimer(MAPRESTARTTIME, RM_Match_MapRestart_Timer, hDp); + hDp.WriteString(sMap); + RM_hUnloaded.BoolValue = false; + } + } + + RM_hMatchName = FindConVarEx("match_name"); + if (RM_hMatchName == null) + { + RM_hMatchName = CreateConVarEx("match_name", "", "DONT TOUCH THIS CVAR! This is to make it possible to see in error logs which confogl config has troubles!", FCVAR_DONTRECORD | FCVAR_UNLOGGED); + } + + // ChangeLevel + if (LibraryExists("l4d2_changelevel")) + { + RM_bIsChangeLevelAvailable = true; + } } void RM_OnMapStart() { - if (!RM_bIsMatchModeLoaded) - { - return; - } + if (!RM_bIsMatchModeLoaded) + { + return; + } - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] New map, executing match config...", RM_MODULE_NAME); - } + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] New map, executing match config...", RM_MODULE_NAME); + } - RM_Match_Load(); + RM_Match_Load(); } void RM_OnClientPutInServer() { - if (!RM_hAutoLoad.BoolValue || RM_bIsAMatchActive) - { - return; - } + if (!RM_hAutoLoad.BoolValue || RM_bIsAMatchActive) + { + return; + } - char buffer[128]; - RM_hAutoCfg.GetString(buffer, sizeof(buffer)); + char buffer[128]; + RM_hAutoCfg.GetString(buffer, sizeof(buffer)); - RM_UpdateCfgOn(buffer); - RM_Match_Load(); + RM_UpdateCfgOn(buffer); + RM_Match_Load(); } static void RM_Match_Load() { - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match Load", RM_MODULE_NAME); - } - - if (!RM_bIsAMatchActive) - { - RM_bIsAMatchActive = true; - } - - RM_hSbAllBotGame.SetInt(1); - char sBuffer[128]; - - if (!RM_bIsPluginsLoaded) - { - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Loading plugins and reload self", RM_MODULE_NAME); - } - - RM_hReloaded.SetInt(1); - RM_hConfigFile_Plugins.GetString(sBuffer, sizeof(sBuffer)); - - // ExecuteCfg(sBuffer); //original - // rework - char sPieces[32][256]; - int iNumPieces = ExplodeString(sBuffer, ";", sPieces, sizeof(sPieces), sizeof(sPieces[])); - - // Unlocking and Unloading Plugins. - ServerCommand("sm plugins load_unlock"); - ServerCommand("sm plugins unload_all"); - - // Loading Plugins. - for (int i = 0; i < iNumPieces; i++) - { - ExecuteCfg(sPieces[i]); - } - // rework end - - return; - } - - RM_hConfigFile_On.GetString(sBuffer, sizeof(sBuffer)); - ExecuteCfg(sBuffer); - - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match config executed", RM_MODULE_NAME); - } - - if (RM_bIsMatchModeLoaded) - { - return; - } - - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Setting match mode active", RM_MODULE_NAME); - } - - RM_bIsMatchModeLoaded = true; - IsPluginEnabled(true, true); - - // PrintToChatAll("\x01[\x05Confogl\x01] Match mode loaded!"); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Match mode loaded!"); - - if (!RM_bIsMapRestarted && RM_hDoRestart.BoolValue) - { - char sMap[PLATFORM_MAX_PATH]; - RM_hChangeMap.GetString(sMap, sizeof(sMap)); - - if (strlen(sMap) > 0) - { - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Changing map to {green}%s{default}!", sMap); - } - else { - GetCurrentMap(sMap, sizeof(sMap)); - - // PrintToChatAll("\x01[\x05Confogl\x01] Restarting map!"); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Restarting map!"); - } - - DataPack hDp; - CreateDataTimer(MAPRESTARTTIME, RM_Match_MapRestart_Timer, hDp); - hDp.WriteString(sMap); - } - - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match mode loaded!", RM_MODULE_NAME); - } - - RM_bIsChmatchRequest = false; - - Call_StartForward(RM_hFwdMatchLoad); - Call_Finish(); + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match Load", RM_MODULE_NAME); + } + + RM_bIsAMatchActive = true; + + RM_hSbAllBotGame.SetInt(1); + char sBuffer[128]; + + if (!RM_bIsPluginsLoaded) + { + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Loading plugins and reload self", RM_MODULE_NAME); + } + + RM_hReloaded.BoolValue = true; + RM_hConfigFile_Plugins.GetString(sBuffer, sizeof(sBuffer)); + ExecuteCfg(sBuffer); //original + + // rework + // char sPieces[32][256]; + // int iNumPieces = ExplodeString(sBuffer, ";", sPieces, sizeof(sPieces), sizeof(sPieces[])); + + // Unlocking and Unloading Plugins. + // It is bette to it manually + // ServerCommand("sm plugins load_unlock"); + // ServerCommand("sm plugins unload_all"); + + // Loading Plugins. + // for (int i = 0; i < iNumPieces; i++) + // { + // ExecuteCfg(sPieces[i]); + // } + // rework end + + return; + } + + RM_hConfigFile_On.GetString(sBuffer, sizeof(sBuffer)); + ExecuteCfg(sBuffer); + + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match config executed", RM_MODULE_NAME); + } + + if (RM_bIsMatchModeLoaded) + { + return; + } + + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Setting match mode active", RM_MODULE_NAME); + } + + RM_bIsMatchModeLoaded = true; + IsPluginEnabled(true, true); + + // PrintToChatAll("\x01[\x05Confogl\x01] Match mode loaded!"); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Match mode loaded!"); + + if (!RM_bIsMapRestarted && RM_hDoRestart.BoolValue) + { + char sMap[PLATFORM_MAX_PATH]; + RM_hChangeMap.GetString(sMap, sizeof(sMap)); + + if (strlen(sMap) > 0) + { + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Changing map to {green}%s{default}!", sMap); + } + else { + GetCurrentMap(sMap, sizeof(sMap)); + + // PrintToChatAll("\x01[\x05Confogl\x01] Restarting map!"); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Restarting map!"); + } + + DataPack hDp; + CreateDataTimer(MAPRESTARTTIME, RM_Match_MapRestart_Timer, hDp); + hDp.WriteString(sMap); + } + + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match mode loaded!", RM_MODULE_NAME); + } + + // RM_bIsChmatchRequest = false; + + Call_StartForward(RM_hFwdMatchLoad); + Call_Finish(); } static void RM_Match_Unload(bool bForced = false) { - bool bIsHumansOnServer = IsHumansOnServer(); - - if (!bIsHumansOnServer || bForced) - { - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match is no longer active, sb_all_bot_game reset to 0, IsHumansOnServer %b, bForced %b", RM_MODULE_NAME, bIsHumansOnServer, bForced); - } - - RM_bIsAMatchActive = false; - RM_hSbAllBotGame.SetInt(0); - } - - if (bIsHumansOnServer && !bForced) - { - return; - } - - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Unloading match mode...", RM_MODULE_NAME); - } - - char sBuffer[128]; - RM_bIsMatchModeLoaded = false; - IsPluginEnabled(true, false); - RM_bIsMapRestarted = false; - RM_bIsPluginsLoaded = false; - - Call_StartForward(RM_hFwdMatchUnload); - Call_Finish(); - - // PrintToChatAll("\x01[\x05Confogl\x01] Match mode unloaded!"); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Match mode unloaded!"); - - RM_hConfigFile_Off.GetString(sBuffer, sizeof(sBuffer)); - - if (!RM_bIsChmatchRequest) - { - ExecuteCfg(sBuffer); - } - else - { - // if we are using chmatch, don't let predictable_unloader unload confogl itself. - // all plugins will be unload and load when the new config excuted. - ServerCommand("sm plugins load_unlock"); - ServerCommand("sm plugins unload optional/predictable_unloader.smx"); - ExecuteCfg(sBuffer); - } - - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match mode unloaded!", RM_MODULE_NAME); - } + bool bIsHumansOnServer = IsHumansOnServer(); + + if (!bIsHumansOnServer || bForced) + { + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match is no longer active, sb_all_bot_game reset to 0, IsHumansOnServer %b, bForced %b", RM_MODULE_NAME, bIsHumansOnServer, bForced); + } + + RM_bIsAMatchActive = false; + RM_hSbAllBotGame.SetInt(0); + } + + if (bIsHumansOnServer && !bForced) + { + return; + } + + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Unloading match mode...", RM_MODULE_NAME); + } + + Call_StartForward(RM_hFwdMatchUnload); + Call_Finish(); + + // PrintToChatAll("\x01[\x05Confogl\x01] Match mode unloaded!"); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Match mode unloaded!"); + + char sBuffer[128]; + RM_hConfigFile_Off.GetString(sBuffer, sizeof(sBuffer)); + ExecuteCfg(sBuffer); + + RM_bIsMatchModeLoaded = false; + IsPluginEnabled(true, false); + RM_bIsMapRestarted = false; + RM_bIsPluginsLoaded = false; + RM_hUnloaded.BoolValue = true; + + // if (!RM_bIsChmatchRequest) + // { + // ExecuteCfg(sBuffer); + // } + // else + // { + // if we are using chmatch, don't let predictable_unloader unload confogl itself. + // all plugins will be unload and load when the new config excuted. + // ServerCommand("sm plugins load_unlock"); + // ServerCommand("sm plugins unload optional/predictable_unloader.smx"); + // ExecuteCfg(sBuffer); + // } + + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match mode unloaded!", RM_MODULE_NAME); + } } public Action RM_Match_MapRestart_Timer(Handle hTimer, DataPack hDp) { - ServerCommand("sm plugins load_lock"); // rework + // ServerCommand("sm plugins load_lock"); // rework // elias: please don't - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Restarting map...", RM_MODULE_NAME); - } + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Restarting map...", RM_MODULE_NAME); + } - char sMap[PLATFORM_MAX_PATH]; - hDp.Reset(); - hDp.ReadString(sMap, sizeof(sMap)); + char sMap[PLATFORM_MAX_PATH]; + hDp.Reset(); + hDp.ReadString(sMap, sizeof(sMap)); - if (RM_bIsChangeLevelAvailable) L4D2_ChangeLevel(sMap); - else ServerCommand("changelevel %s", sMap); + if (RM_bIsChangeLevelAvailable) L4D2_ChangeLevel(sMap); + else ServerCommand("changelevel %s", sMap); - RM_bIsMapRestarted = true; + RM_bIsMapRestarted = true; - return Plugin_Stop; + return Plugin_Stop; } static bool RM_UpdateCfgOn(const char[] cfgfile, bool bIsPrint = true) { - if (SetCustomCfg(cfgfile)) - { - // PrintToChatAll("\x01[\x05Confogl\x01] Using \"\x04%s\x01\" config.", cfgfile); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Loading '{olive}%s{default}'.", cfgfile); - - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Starting match on config %s", RM_MODULE_NAME, cfgfile); - } - - return true; - } - - if (bIsPrint) - { - // PrintToChatAll("\x01[\x05Confogl\x01] Config \"\x04%s\x01\" not found, using default config!", cfgfile); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Config '{olive}%s{default}' not found, using default config!", cfgfile); - } - - return false; + if (SetCustomCfg(cfgfile)) + { + // PrintToChatAll("\x01[\x05Confogl\x01] Using \"\x04%s\x01\" config.", cfgfile); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Loading '{olive}%s{default}'.", cfgfile); + RM_hMatchName.SetString(cfgfile); + + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Starting match on config %s", RM_MODULE_NAME, cfgfile); + } + + return true; + } + + if (bIsPrint) + { + // PrintToChatAll("\x01[\x05Confogl\x01] Config \"\x04%s\x01\" not found, using default config!", cfgfile); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Config '{olive}%s{default}' not found, using default config!", cfgfile); + } + + return false; } public Action RM_Cmd_ForceMatch(int client, int args) { - if (RM_bIsMatchModeLoaded) - { - return Plugin_Handled; - } - - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match mode forced to load!", RM_MODULE_NAME); - } - - if (args < 1) - { - // SetCustomCfg(""); //old code - // RM_Match_Load(); //old code - - if (client == 0) - { - PrintToServer("[Confogl] Please specify a config to load."); - } - else { - // PrintToChat(client, "\x01[\x05Confogl\x01] Please specify a \x04config\x01 to load."); - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Please specify a {olive}config{default} to load."); - } - return Plugin_Handled; - } - - char sBuffer[128]; - GetCmdArg(1, sBuffer, sizeof(sBuffer)); - - // RM_UpdateCfgOn(sBuffer); //old code - - if (!RM_UpdateCfgOn(sBuffer, false)) - { - if (client == 0) - { - PrintToServer("[Confogl] Config %s not found!", sBuffer); - } - else { - // PrintToChat(client, "\x01[\x05Confogl\x01] Please specify a \"\x04%s\x01\" to load.", sBuffer); - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Config '{olive}%s{default}' not found!", sBuffer); - } - - return Plugin_Handled; - } - - char sMap[PLATFORM_MAX_PATH], sDisplayName[PLATFORM_MAX_PATH]; - - if (args == 2) - { - GetCmdArg(2, sMap, sizeof(sMap)); - - if (FindMap(sMap, sDisplayName, sizeof(sDisplayName)) == FindMap_NotFound) - { - if (client == 0) - { - PrintToServer("[Confogl] Map %s not found!", sMap); - } - else { - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Map '{olive}%s{default}' not found!", sMap); - } - return Plugin_Handled; - } - - GetMapDisplayName(sDisplayName, sDisplayName, sizeof(sDisplayName)); - RM_hChangeMap.SetString(sDisplayName); - } - - RM_Match_Load(); - - return Plugin_Handled; + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match mode forced to load!", RM_MODULE_NAME); + } + + if (args < 1) + { + // SetCustomCfg(""); //old code + // RM_Match_Load(); //old code + + if (client == 0) + { + PrintToServer("[Confogl] Please specify a config to load."); + } + else { + // PrintToChat(client, "\x01[\x05Confogl\x01] Please specify a \x04config\x01 to load."); + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Please specify a {olive}config{default} to load."); + } + + return Plugin_Handled; + } + + char sBuffer[128]; + GetCmdArg(1, sBuffer, sizeof(sBuffer)); + + // RM_UpdateCfgOn(sBuffer); //old code + + if (!RM_UpdateCfgOn(sBuffer, false)) + { + if (client == 0) + { + PrintToServer("[Confogl] Config %s not found!", sBuffer); + } + else { + // PrintToChat(client, "\x01[\x05Confogl\x01] Please specify a \"\x04%s\x01\" to load.", sBuffer); + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Config '{olive}%s{default}' not found!", sBuffer); + } + + return Plugin_Handled; + } + + char sMap[PLATFORM_MAX_PATH], sDisplayName[PLATFORM_MAX_PATH]; + + if (args == 2) + { + GetCmdArg(2, sMap, sizeof(sMap)); + + if (FindMap(sMap, sDisplayName, sizeof(sDisplayName)) == FindMap_NotFound) + { + if (client == 0) + { + PrintToServer("[Confogl] Map %s not found!", sMap); + } + else + { + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Map '{olive}%s{default}' not found!", sMap); + } + + return Plugin_Handled; + } + + GetMapDisplayName(sDisplayName, sDisplayName, sizeof(sDisplayName)); + RM_hChangeMap.SetString(sDisplayName); + } + + if (RM_bIsMatchModeLoaded) + { + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match already loaded, resetting...", RM_MODULE_NAME); + } + + IsPluginEnabled(true, false); + RM_bIsMatchModeLoaded = false; + RM_bIsMapRestarted = false; + RM_bIsPluginsLoaded = false; + ClearAllSettings(); + ClearAllCvars(); + Call_StartForward(RM_hFwdMatchUnload); + Call_Finish(); + } + + RM_Match_Load(); + + return Plugin_Handled; } public Action RM_Cmd_ResetMatch(int client, int args) { - if (!RM_bIsMatchModeLoaded) - { - return Plugin_Handled; - } + if (!RM_bIsMatchModeLoaded) + { + return Plugin_Handled; + } - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match mode forced to unload!", RM_MODULE_NAME); - } + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match mode forced to unload!", RM_MODULE_NAME); + } - RM_Match_Unload(true); + RM_Match_Unload(true); - return Plugin_Handled; + return Plugin_Handled; } +/** Nah, we do it our way public Action RM_CMD_ChangeMatch(int client, int args) { - if (args < 1) - { - if (client == 0) - { - PrintToServer("[Confogl] Please specify a config to load."); - } - else { - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Please specify a {olive}config{default} to load."); - } - return Plugin_Handled; - } - - char sBuffer[128]; - GetCmdArg(1, sBuffer, sizeof(sBuffer)); - - if (!RM_UpdateCfgOn(sBuffer, false)) - { - if (client == 0) - { - PrintToServer("[Confogl] Config %s not found!", sBuffer); - } - else { - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Config '{olive}%s{default}' not found!", sBuffer); - } - - return Plugin_Handled; - } - - char sMap[PLATFORM_MAX_PATH], sDisplayName[PLATFORM_MAX_PATH]; - - if (args == 2) - { - GetCmdArg(2, sMap, sizeof(sMap)); - - if (FindMap(sMap, sDisplayName, sizeof(sDisplayName)) == FindMap_NotFound) - { - if (client == 0) - { - PrintToServer("[Confogl] Map %s not found!", sMap); - } - else { - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Map '{olive}%s{default}' not found!", sMap); - } - return Plugin_Handled; - } - - GetMapDisplayName(sDisplayName, sDisplayName, sizeof(sDisplayName)); - RM_hChangeMap.SetString(sDisplayName); - } - - // Unload - if (!RM_bIsMatchModeLoaded) - { - return Plugin_Handled; - } - - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match mode forced to unload! [Change in this case!]", RM_MODULE_NAME); - } - - RM_bIsChmatchRequest = true; - - RM_Match_Unload(true); - - // give time to fully finish unloading. - CreateTimer(1.0, Timer_DelayToLoadMatchMode); - - return Plugin_Handled; + if (args < 1) + { + if (client == 0) + { + PrintToServer("[Confogl] Please specify a config to load."); + } + else { + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Please specify a {olive}config{default} to load."); + } + return Plugin_Handled; + } + + char sBuffer[128]; + GetCmdArg(1, sBuffer, sizeof(sBuffer)); + + if (!RM_UpdateCfgOn(sBuffer, false)) + { + if (client == 0) + { + PrintToServer("[Confogl] Config %s not found!", sBuffer); + } + else { + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Config '{olive}%s{default}' not found!", sBuffer); + } + + return Plugin_Handled; + } + + char sMap[PLATFORM_MAX_PATH], sDisplayName[PLATFORM_MAX_PATH]; + + if (args == 2) + { + GetCmdArg(2, sMap, sizeof(sMap)); + + if (FindMap(sMap, sDisplayName, sizeof(sDisplayName)) == FindMap_NotFound) + { + if (client == 0) + { + PrintToServer("[Confogl] Map %s not found!", sMap); + } + else { + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Map '{olive}%s{default}' not found!", sMap); + } + return Plugin_Handled; + } + + GetMapDisplayName(sDisplayName, sDisplayName, sizeof(sDisplayName)); + RM_hChangeMap.SetString(sDisplayName); + } + + // Unload + if (!RM_bIsMatchModeLoaded) + { + return Plugin_Handled; + } + + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match mode forced to unload! [Change in this case!]", RM_MODULE_NAME); + } + + RM_bIsChmatchRequest = true; + + RM_Match_Unload(true); + + // give time to fully finish unloading. + CreateTimer(1.0, Timer_DelayToLoadMatchMode); // what? + + return Plugin_Handled; } public Action Timer_DelayToLoadMatchMode(Handle timer) { - // Load - if (RM_bIsMatchModeLoaded) - { - return Plugin_Handled; - } + // Load + if (RM_bIsMatchModeLoaded) + { + return Plugin_Handled; + } - if (RM_DEBUG || IsDebugEnabled()) - { - LogMessage("[%s] Match mode forced to load! [Change in this case!]", RM_MODULE_NAME); - } + if (RM_DEBUG || IsDebugEnabled()) + { + LogMessage("[%s] Match mode forced to load! [Change in this case!]", RM_MODULE_NAME); + } - RM_Match_Load(); + RM_Match_Load(); - return Plugin_Handled; + return Plugin_Handled; } +**/ /*public Action RM_Cmd_Match(int client, int args) { - if (RM_bIsMatchModeLoaded || (!IsVersus() && !IsScavenge()) || !RM_hAllowVoting.BoolValue) { - return Plugin_Handled; - } - - int iTeam = GetClientTeam(client); - if ((iTeam == L4D2Team_Survivor || iTeam == L4D2Team_Infected) && !RM_bMatchRequest[iTeam - 2]) { - RM_bMatchRequest[iTeam - 2] = true; - } else { - return Plugin_Handled; - } - - if (RM_bMatchRequest[0] && RM_bMatchRequest[1]) { - //PrintToChatAll("\x01[\x05Confogl\x01] Both teams have agreed to start a competitive match!"); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Both teams have agreed to start a competitive match!"); - - RM_Match_Load(); - } else if (RM_bMatchRequest[0] || RM_bMatchRequest[1]) { - //PrintToChatAll("\x01[\x05Confogl\x01] The \x04%s\x01 have requested to start a competitive match. The \x04%s\x01 must accept with match command!", - //g_sTeamName[iTeam + 4], g_sTeamName[iTeam + 3]); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} The {olive}%s{default} have requested to start a competitive match. The {olive}%s{default} must accept with match command!", \ - g_sTeamName[iTeam + 4], g_sTeamName[iTeam + 3]); - - if (args > 0) { // cfgfile specified - char sBuffer[128]; - GetCmdArg(1, sBuffer, sizeof(sBuffer)); - RM_UpdateCfgOn(sBuffer); - } else { - SetCustomCfg(""); - } - - CreateTimer(30.0, RM_MatchRequestTimeout); - } - - return Plugin_Handled; + if (RM_bIsMatchModeLoaded || (!IsVersus() && !IsScavenge()) || !RM_hAllowVoting.BoolValue) { + return Plugin_Handled; + } + + int iTeam = GetClientTeam(client); + if ((iTeam == L4D2Team_Survivor || iTeam == L4D2Team_Infected) && !RM_bMatchRequest[iTeam - 2]) { + RM_bMatchRequest[iTeam - 2] = true; + } else { + return Plugin_Handled; + } + + if (RM_bMatchRequest[0] && RM_bMatchRequest[1]) { + //PrintToChatAll("\x01[\x05Confogl\x01] Both teams have agreed to start a competitive match!"); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Both teams have agreed to start a competitive match!"); + + RM_Match_Load(); + } else if (RM_bMatchRequest[0] || RM_bMatchRequest[1]) { + //PrintToChatAll("\x01[\x05Confogl\x01] The \x04%s\x01 have requested to start a competitive match. The \x04%s\x01 must accept with match command!", + //g_sTeamName[iTeam + 4], g_sTeamName[iTeam + 3]); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} The {olive}%s{default} have requested to start a competitive match. The {olive}%s{default} must accept with match command!", \ + g_sTeamName[iTeam + 4], g_sTeamName[iTeam + 3]); + + if (args > 0) { // cfgfile specified + char sBuffer[128]; + GetCmdArg(1, sBuffer, sizeof(sBuffer)); + RM_UpdateCfgOn(sBuffer); + } else { + SetCustomCfg(""); + } + + CreateTimer(30.0, RM_MatchRequestTimeout); + } + + return Plugin_Handled; } public Action RM_MatchRequestTimeout(Handle hTimer) { - RM_ResetMatchRequest(); + RM_ResetMatchRequest(); - return Plugin_Stop; + return Plugin_Stop; }*/ void RM_OnClientDisconnect(int client) { - if (!RM_bIsMatchModeLoaded || IsFakeClient(client)) - { - return; - } + if (!RM_bIsMatchModeLoaded || IsFakeClient(client)) + { + return; + } - CreateTimer(RESETMINTIME, RM_MatchResetTimer); + CreateTimer(RESETMINTIME, RM_MatchResetTimer); } public Action RM_MatchResetTimer(Handle hTimer) { - RM_Match_Unload(); + RM_Match_Unload(); - return Plugin_Stop; + return Plugin_Stop; } /*static void RM_ResetMatchRequest() { - RM_hConfigFile_On.RestoreDefault(); + RM_hConfigFile_On.RestoreDefault(); - RM_bMatchRequest[0] = false; - RM_bMatchRequest[1] = false; + RM_bMatchRequest[0] = false; + RM_bMatchRequest[1] = false; }*/ stock bool IsAMatchActive() { - return RM_bIsAMatchActive; + return RM_bIsAMatchActive; +} + +stock void GetMatchName(char[] sBuffer, int iLen) +{ + RM_hMatchName.GetString(sBuffer, iLen); } public int native_IsMatchModeLoaded(Handle plugin, int numParams) { - return RM_bIsMatchModeLoaded; + return RM_bIsMatchModeLoaded; } diff --git a/addons/sourcemod/scripting/confoglcompmod/ScoreMod.sp b/addons/sourcemod/scripting/confoglcompmod/ScoreMod.sp index 87dcdea33..80756bda7 100644 --- a/addons/sourcemod/scripting/confoglcompmod/ScoreMod.sp +++ b/addons/sourcemod/scripting/confoglcompmod/ScoreMod.sp @@ -1,515 +1,515 @@ #if defined __scoremod_included - #endinput + #endinput #endif #define __scoremod_included -#define DEBUG_SM 0 -#define SM_MODULE_NAME "ScoreMod" +#define DEBUG_SM 0 +#define SM_MODULE_NAME "ScoreMod" static int - SM_iDefaultSurvivalBonus = 0, - SM_iDefaultTieBreaker = 0, - SM_iPillPercent = 0, - SM_iAdrenPercent = 0, - SM_iFirstScore = 0; + SM_iDefaultSurvivalBonus = 0, + SM_iDefaultTieBreaker = 0, + SM_iPillPercent = 0, + SM_iAdrenPercent = 0, + SM_iFirstScore = 0; static float - SM_fHealPercent = 0.0, - SM_fMapMulti = 0.0, - SM_fHBRatio = 0.0, - SM_fSurvivalBonusRatio = 0.0, - SM_fTempMulti[3] = {0.0, ...}; + SM_fHealPercent = 0.0, + SM_fMapMulti = 0.0, + SM_fHBRatio = 0.0, + SM_fSurvivalBonusRatio = 0.0, + SM_fTempMulti[3] = {0.0, ...}; static bool - SM_bEventsHooked = false, - SM_bModuleIsEnabled = false, - SM_bHooked = false, - SM_bIsFirstRoundOver = false, - SM_bIsSecondRoundStarted = false, - SM_bIsSecondRoundOver = false; + SM_bEventsHooked = false, + SM_bModuleIsEnabled = false, + SM_bHooked = false, + SM_bIsFirstRoundOver = false, + SM_bIsSecondRoundStarted = false, + SM_bIsSecondRoundOver = false; // Cvars static ConVar - SM_hEnable = null, - SM_hHBRatio = null, - SM_hSurvivalBonusRatio = null, - SM_hMapMulti = null, - SM_hCustomMaxDistance = null; + SM_hEnable = null, + SM_hHBRatio = null, + SM_hSurvivalBonusRatio = null, + SM_hMapMulti = null, + SM_hCustomMaxDistance = null; // Default Cvar Values static ConVar - SM_hSurvivalBonus = null, - SM_hTieBreaker = null, - SM_hHealPercent = null, - SM_hPillPercent = null, - SM_hAdrenPercent = null, - SM_hTempMulti0 = null, - SM_hTempMulti1 = null, - SM_hTempMulti2 = null; + SM_hSurvivalBonus = null, + SM_hTieBreaker = null, + SM_hHealPercent = null, + SM_hPillPercent = null, + SM_hAdrenPercent = null, + SM_hTempMulti0 = null, + SM_hTempMulti1 = null, + SM_hTempMulti2 = null; void SM_APL() { - CreateNative("LGO_IsScoremodEnabled", Native_IsScoremodEnabled); - CreateNative("LGO_GetScoremodBonus", Native_GetScoremodBonus); + CreateNative("LGO_IsScoremodEnabled", Native_IsScoremodEnabled); + CreateNative("LGO_GetScoremodBonus", Native_GetScoremodBonus); } void SM_OnModuleStart() { - SM_hEnable = CreateConVarEx("SM_enable", "1", "L4D2 Custom Scoring - Enable/Disable", _, true, 0.0, true, 1.0); - SM_hHBRatio = CreateConVarEx("SM_healthbonusratio", "2.0", "L4D2 Custom Scoring - Healthbonus Multiplier", _, true, 0.25, true, 5.0); - SM_hSurvivalBonusRatio = CreateConVarEx("SM_survivalbonusratio", "0.0", "Ratio to be used for a static survival bonus against Map distance. 25% == 100 points maximum health bonus on a 400 distance map", _); - SM_hTempMulti0 = CreateConVarEx("SM_tempmulti_incap_0", "0.30625", "L4D2 Custom Scoring - How important temp health is on survivors who have had no incaps", _, true, 0.0, true, 1.0); - SM_hTempMulti1 = CreateConVarEx("SM_tempmulti_incap_1", "0.17500", "L4D2 Custom Scoring - How important temp health is on survivors who have had one incap", _, true, 0.0, true, 1.0); - SM_hTempMulti2 = CreateConVarEx("SM_tempmulti_incap_2", "0.10000", "L4D2 Custom Scoring - How important temp health is on survivors who have had two incaps (black and white)", _, true, 0.0, true, 1.0); - SM_hMapMulti = CreateConVarEx("SM_mapmulti", "1", "L4D2 Custom Scoring - Increases Healthbonus Max to Distance Max", _, true, 0.0, true, 1.0); - SM_hCustomMaxDistance = CreateConVarEx("SM_custommaxdistance", "0", "L4D2 Custom Scoring - Custom max distance from config", _, true, 0.0, true, 1.0); - - SM_fTempMulti[0] = SM_hTempMulti0.FloatValue; - SM_fTempMulti[1] = SM_hTempMulti1.FloatValue; - SM_fTempMulti[2] = SM_hTempMulti2.FloatValue; - - SM_hEnable.AddChangeHook(SM_ConVarChanged_Enable); - SM_hHBRatio.AddChangeHook(SM_CVChanged_HealthBonusRatio); - SM_hSurvivalBonusRatio.AddChangeHook(SM_CVChanged_SurvivalBonusRatio); - SM_hTempMulti0.AddChangeHook(SM_ConVarChanged_TempMulti0); - SM_hTempMulti1.AddChangeHook(SM_ConVarChanged_TempMulti1); - SM_hTempMulti2.AddChangeHook(SM_ConVarChanged_TempMulti2); - - SM_hSurvivalBonus = FindConVar("vs_survival_bonus"); - SM_hTieBreaker = FindConVar("vs_tiebreak_bonus"); - SM_hHealPercent = FindConVar("first_aid_heal_percent"); - SM_hPillPercent = FindConVar("pain_pills_health_value"); - SM_hAdrenPercent = FindConVar("adrenaline_health_buffer"); - - SM_fHealPercent = SM_hHealPercent.FloatValue; - SM_iPillPercent = SM_hPillPercent.IntValue; - SM_iAdrenPercent = SM_hAdrenPercent.IntValue; - SM_iDefaultSurvivalBonus = SM_hSurvivalBonus.IntValue; - SM_iDefaultTieBreaker = SM_hTieBreaker.IntValue; - - SM_hHealPercent.AddChangeHook(SM_ConVarChanged_Health); - SM_hPillPercent.AddChangeHook(SM_ConVarChanged_Health); - SM_hAdrenPercent.AddChangeHook(SM_ConVarChanged_Health); - - RegConsoleCmd("sm_health", SM_Cmd_Health); - RegConsoleCmd("sm_bonus", SM_Cmd_Health); + SM_hEnable = CreateConVarEx("SM_enable", "1", "L4D2 Custom Scoring - Enable/Disable", _, true, 0.0, true, 1.0); + SM_hHBRatio = CreateConVarEx("SM_healthbonusratio", "2.0", "L4D2 Custom Scoring - Healthbonus Multiplier", _, true, 0.25, true, 5.0); + SM_hSurvivalBonusRatio = CreateConVarEx("SM_survivalbonusratio", "0.0", "Ratio to be used for a static survival bonus against Map distance. 25% == 100 points maximum health bonus on a 400 distance map", _); + SM_hTempMulti0 = CreateConVarEx("SM_tempmulti_incap_0", "0.30625", "L4D2 Custom Scoring - How important temp health is on survivors who have had no incaps", _, true, 0.0, true, 1.0); + SM_hTempMulti1 = CreateConVarEx("SM_tempmulti_incap_1", "0.17500", "L4D2 Custom Scoring - How important temp health is on survivors who have had one incap", _, true, 0.0, true, 1.0); + SM_hTempMulti2 = CreateConVarEx("SM_tempmulti_incap_2", "0.10000", "L4D2 Custom Scoring - How important temp health is on survivors who have had two incaps (black and white)", _, true, 0.0, true, 1.0); + SM_hMapMulti = CreateConVarEx("SM_mapmulti", "1", "L4D2 Custom Scoring - Increases Healthbonus Max to Distance Max", _, true, 0.0, true, 1.0); + SM_hCustomMaxDistance = CreateConVarEx("SM_custommaxdistance", "0", "L4D2 Custom Scoring - Custom max distance from config", _, true, 0.0, true, 1.0); + + SM_fTempMulti[0] = SM_hTempMulti0.FloatValue; + SM_fTempMulti[1] = SM_hTempMulti1.FloatValue; + SM_fTempMulti[2] = SM_hTempMulti2.FloatValue; + + SM_hEnable.AddChangeHook(SM_ConVarChanged_Enable); + SM_hHBRatio.AddChangeHook(SM_CVChanged_HealthBonusRatio); + SM_hSurvivalBonusRatio.AddChangeHook(SM_CVChanged_SurvivalBonusRatio); + SM_hTempMulti0.AddChangeHook(SM_ConVarChanged_TempMulti0); + SM_hTempMulti1.AddChangeHook(SM_ConVarChanged_TempMulti1); + SM_hTempMulti2.AddChangeHook(SM_ConVarChanged_TempMulti2); + + SM_hSurvivalBonus = FindConVar("vs_survival_bonus"); + SM_hTieBreaker = FindConVar("vs_tiebreak_bonus"); + SM_hHealPercent = FindConVar("first_aid_heal_percent"); + SM_hPillPercent = FindConVar("pain_pills_health_value"); + SM_hAdrenPercent = FindConVar("adrenaline_health_buffer"); + + SM_fHealPercent = SM_hHealPercent.FloatValue; + SM_iPillPercent = SM_hPillPercent.IntValue; + SM_iAdrenPercent = SM_hAdrenPercent.IntValue; + SM_iDefaultSurvivalBonus = SM_hSurvivalBonus.IntValue; + SM_iDefaultTieBreaker = SM_hTieBreaker.IntValue; + + SM_hHealPercent.AddChangeHook(SM_ConVarChanged_Health); + SM_hPillPercent.AddChangeHook(SM_ConVarChanged_Health); + SM_hAdrenPercent.AddChangeHook(SM_ConVarChanged_Health); + + RegConsoleCmd("sm_health", SM_Cmd_Health); + RegConsoleCmd("sm_bonus", SM_Cmd_Health); } void SM_OnModuleEnd() { - PluginDisable(false); + PluginDisable(false); } void SM_OnMapStart() { - if (!IsPluginEnabled()) { - return; - } - - SM_fMapMulti = (!SM_hMapMulti.BoolValue) ? 1.00 : float(L4D_GetVersusMaxCompletionScore()) / 400.0; - - SM_bModuleIsEnabled = SM_hEnable.BoolValue; - - if (SM_bModuleIsEnabled && !SM_bHooked) { - PluginEnable(); - } - - if (SM_bModuleIsEnabled) { - SM_hTieBreaker.SetInt(0); - } - - if (SM_bModuleIsEnabled && SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { - L4D_SetVersusMaxCompletionScore(GetCustomMapMaxScore()); - // to allow a distance score of 0 and a health bonus - if (GetCustomMapMaxScore() > 0) { - SM_fMapMulti = float(GetCustomMapMaxScore()) / 400.0; - } - } - - SM_bIsFirstRoundOver = false; - SM_bIsSecondRoundStarted = false; - SM_bIsSecondRoundOver = false; - SM_iFirstScore = 0; - - SM_fTempMulti[0] = SM_hTempMulti0.FloatValue; - SM_fTempMulti[1] = SM_hTempMulti1.FloatValue; - SM_fTempMulti[2] = SM_hTempMulti2.FloatValue; + if (!IsPluginEnabled()) { + return; + } + + SM_fMapMulti = (!SM_hMapMulti.BoolValue) ? 1.00 : float(L4D_GetVersusMaxCompletionScore()) / 400.0; + + SM_bModuleIsEnabled = SM_hEnable.BoolValue; + + if (SM_bModuleIsEnabled && !SM_bHooked) { + PluginEnable(); + } + + if (SM_bModuleIsEnabled) { + SM_hTieBreaker.SetInt(0); + } + + if (SM_bModuleIsEnabled && SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { + L4D_SetVersusMaxCompletionScore(GetCustomMapMaxScore()); + // to allow a distance score of 0 and a health bonus + if (GetCustomMapMaxScore() > 0) { + SM_fMapMulti = float(GetCustomMapMaxScore()) / 400.0; + } + } + + SM_bIsFirstRoundOver = false; + SM_bIsSecondRoundStarted = false; + SM_bIsSecondRoundOver = false; + SM_iFirstScore = 0; + + SM_fTempMulti[0] = SM_hTempMulti0.FloatValue; + SM_fTempMulti[1] = SM_hTempMulti1.FloatValue; + SM_fTempMulti[2] = SM_hTempMulti2.FloatValue; } public void SM_ConVarChanged_Enable(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - if (StringToInt(sNewValue) == 0) { - PluginDisable(); - SM_bModuleIsEnabled = false; - } else { - PluginEnable(); - SM_bModuleIsEnabled = true; - } + if (StringToInt(sNewValue) == 0) { + PluginDisable(); + SM_bModuleIsEnabled = false; + } else { + PluginEnable(); + SM_bModuleIsEnabled = true; + } } public void SM_ConVarChanged_TempMulti0(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - SM_fTempMulti[0] = StringToFloat(sNewValue); + SM_fTempMulti[0] = StringToFloat(sNewValue); } public void SM_ConVarChanged_TempMulti1(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - SM_fTempMulti[1] = StringToFloat(sNewValue); + SM_fTempMulti[1] = StringToFloat(sNewValue); } public void SM_ConVarChanged_TempMulti2(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - SM_fTempMulti[2] = StringToFloat(sNewValue); + SM_fTempMulti[2] = StringToFloat(sNewValue); } public void SM_CVChanged_HealthBonusRatio(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - SM_fHBRatio = StringToFloat(sNewValue); + SM_fHBRatio = StringToFloat(sNewValue); } public void SM_CVChanged_SurvivalBonusRatio(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - SM_fSurvivalBonusRatio = StringToFloat(sNewValue); + SM_fSurvivalBonusRatio = StringToFloat(sNewValue); } public void SM_ConVarChanged_Health(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - SM_fHealPercent = SM_hHealPercent.FloatValue; - SM_iPillPercent = SM_hPillPercent.IntValue; - SM_iAdrenPercent = SM_hAdrenPercent.IntValue; + SM_fHealPercent = SM_hHealPercent.FloatValue; + SM_iPillPercent = SM_hPillPercent.IntValue; + SM_iAdrenPercent = SM_hAdrenPercent.IntValue; } static void PluginEnable() { - ToggleHook(true); + ToggleHook(true); - SM_fHBRatio = SM_hHBRatio.FloatValue; - SM_fSurvivalBonusRatio = SM_hSurvivalBonusRatio.FloatValue; - SM_iDefaultSurvivalBonus = SM_hSurvivalBonus.IntValue; - SM_iDefaultTieBreaker = SM_hTieBreaker.IntValue; + SM_fHBRatio = SM_hHBRatio.FloatValue; + SM_fSurvivalBonusRatio = SM_hSurvivalBonusRatio.FloatValue; + SM_iDefaultSurvivalBonus = SM_hSurvivalBonus.IntValue; + SM_iDefaultTieBreaker = SM_hTieBreaker.IntValue; - SM_hTieBreaker.SetInt(0); + SM_hTieBreaker.SetInt(0); - SM_fHealPercent = SM_hHealPercent.FloatValue; - SM_iPillPercent = SM_hPillPercent.IntValue; - SM_iAdrenPercent = SM_hAdrenPercent.IntValue; + SM_fHealPercent = SM_hHealPercent.FloatValue; + SM_iPillPercent = SM_hPillPercent.IntValue; + SM_iAdrenPercent = SM_hAdrenPercent.IntValue; - SM_bHooked = true; + SM_bHooked = true; } static void ToggleHook(bool bIsHook) { - if (bIsHook) { - if (!SM_bEventsHooked) { - HookEvent("door_close", SM_DoorClose_Event); - HookEvent("player_death", SM_PlayerDeath_Event); - HookEvent("round_end", SM_RoundEnd_Event, EventHookMode_PostNoCopy); - HookEvent("round_start", SM_RoundStart_Event, EventHookMode_PostNoCopy); - HookEvent("finale_vehicle_leaving", SM_FinaleVehicleLeaving_Event, EventHookMode_PostNoCopy); - - /*AddCommandListener(SM_Command_Say, "say"); - AddCommandListener(SM_Command_Say, "say_team");*/ - - SM_bEventsHooked = true; - } - } else { - if (SM_bEventsHooked) { - UnhookEvent("door_close", SM_DoorClose_Event); - UnhookEvent("player_death", SM_PlayerDeath_Event); - UnhookEvent("round_end", SM_RoundEnd_Event, EventHookMode_PostNoCopy); - UnhookEvent("round_start", SM_RoundStart_Event, EventHookMode_PostNoCopy); - UnhookEvent("finale_vehicle_leaving", SM_FinaleVehicleLeaving_Event, EventHookMode_PostNoCopy); - - /*RemoveCommandListener(SM_Command_Say, "say"); - RemoveCommandListener(SM_Command_Say, "say_team");*/ - - SM_bEventsHooked = false; - } - } + if (bIsHook) { + if (!SM_bEventsHooked) { + HookEvent("door_close", SM_DoorClose_Event); + HookEvent("player_death", SM_PlayerDeath_Event); + HookEvent("round_end", SM_RoundEnd_Event, EventHookMode_PostNoCopy); + HookEvent("round_start", SM_RoundStart_Event, EventHookMode_PostNoCopy); + HookEvent("finale_vehicle_leaving", SM_FinaleVehicleLeaving_Event, EventHookMode_PostNoCopy); + + /*AddCommandListener(SM_Command_Say, "say"); + AddCommandListener(SM_Command_Say, "say_team");*/ + + SM_bEventsHooked = true; + } + } else { + if (SM_bEventsHooked) { + UnhookEvent("door_close", SM_DoorClose_Event); + UnhookEvent("player_death", SM_PlayerDeath_Event); + UnhookEvent("round_end", SM_RoundEnd_Event, EventHookMode_PostNoCopy); + UnhookEvent("round_start", SM_RoundStart_Event, EventHookMode_PostNoCopy); + UnhookEvent("finale_vehicle_leaving", SM_FinaleVehicleLeaving_Event, EventHookMode_PostNoCopy); + + /*RemoveCommandListener(SM_Command_Say, "say"); + RemoveCommandListener(SM_Command_Say, "say_team");*/ + + SM_bEventsHooked = false; + } + } } static void PluginDisable(bool unhook = true) { - if (unhook) { - ToggleHook(false); - } + if (unhook) { + ToggleHook(false); + } - SM_hSurvivalBonus.SetInt(SM_iDefaultSurvivalBonus); - SM_hTieBreaker.SetInt(SM_iDefaultTieBreaker); + SM_hSurvivalBonus.SetInt(SM_iDefaultSurvivalBonus); + SM_hTieBreaker.SetInt(SM_iDefaultTieBreaker); - SM_bHooked = false; + SM_bHooked = false; } public void SM_DoorClose_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!SM_bModuleIsEnabled || !IsPluginEnabled() || !hEvent.GetBool("checkpoint")) { - return; - } + if (!SM_bModuleIsEnabled || !IsPluginEnabled() || !hEvent.GetBool("checkpoint")) { + return; + } - SM_hSurvivalBonus.SetInt(SM_CalculateSurvivalBonus()); + SM_hSurvivalBonus.SetInt(SM_CalculateSurvivalBonus()); } public void SM_PlayerDeath_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { - return; - } + if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { + return; + } - int client = GetClientOfUserId(hEvent.GetInt("userid")); + int client = GetClientOfUserId(hEvent.GetInt("userid")); - // Can't just check for fakeclient - if (client > 0 && GetClientTeam(client) == L4D2Team_Survivor) { - SM_hSurvivalBonus.SetInt(SM_CalculateSurvivalBonus()); - } + // Can't just check for fakeclient + if (client > 0 && GetClientTeam(client) == L4D2Team_Survivor) { + SM_hSurvivalBonus.SetInt(SM_CalculateSurvivalBonus()); + } } public void SM_RoundEnd_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { - return; - } - - if (!SM_bIsFirstRoundOver) { - // First round just ended, save the current score. - SM_bIsFirstRoundOver = true; - int iAliveCount; - SM_iFirstScore = RoundToFloor(SM_CalculateAvgHealth(iAliveCount) * SM_fMapMulti * SM_fHBRatio + 400 * SM_fMapMulti * SM_fSurvivalBonusRatio * iAliveCount / 4.0); - - // If the score is nonzero, trust the SurvivalBonus var. - SM_iFirstScore = (SM_iFirstScore) ? (SM_hSurvivalBonus.IntValue * iAliveCount) : 0; - - //PrintToChatAll("\x01[\x05Confogl\x01] Round 1 Bonus: \x04%d", SM_iFirstScore); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Round 1 Bonus: {olive}%d", SM_iFirstScore); - - if (SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { - //PrintToChatAll("\x01[\x05Confogl\x01] Custom Max Distance: \x04%d", GetCustomMapMaxScore()); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Custom Max Distance: {olive}%d", GetCustomMapMaxScore()); - } - } else if (SM_bIsSecondRoundStarted && !SM_bIsSecondRoundOver) { - SM_bIsSecondRoundOver = true; - // Second round has ended, print scores - - int iAliveCount; - int iScore = RoundToFloor(SM_CalculateAvgHealth(iAliveCount) * SM_fMapMulti * SM_fHBRatio + 400 * SM_fMapMulti * SM_fSurvivalBonusRatio * iAliveCount / 4.0); - // If the score is nonzero, trust the SurvivalBonus var. - iScore = (iScore) ? (SM_hSurvivalBonus.IntValue * iAliveCount) : 0; - - //PrintToChatAll("\x01[\x05Confogl\x01] Round 1 Bonus: \x04%d", SM_iFirstScore); - //PrintToChatAll("\x01[\x05Confogl\x01] Round 2 Bonus: \x04%d", iScore); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Round 1 Bonus: {olive}%d", SM_iFirstScore); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Round 2 Bonus: {olive}%d", iScore); - - if (SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { - //PrintToChatAll("\x01[\x05Confogl\x01] Custom Max Distance: \x04%d", GetCustomMapMaxScore()); - CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Custom Max Distance: {olive}%d", GetCustomMapMaxScore()); - } - } + if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { + return; + } + + if (!SM_bIsFirstRoundOver) { + // First round just ended, save the current score. + SM_bIsFirstRoundOver = true; + int iAliveCount; + SM_iFirstScore = RoundToFloor(SM_CalculateAvgHealth(iAliveCount) * SM_fMapMulti * SM_fHBRatio + 400 * SM_fMapMulti * SM_fSurvivalBonusRatio * iAliveCount / 4.0); + + // If the score is nonzero, trust the SurvivalBonus var. + SM_iFirstScore = (SM_iFirstScore) ? (SM_hSurvivalBonus.IntValue * iAliveCount) : 0; + + //PrintToChatAll("\x01[\x05Confogl\x01] Round 1 Bonus: \x04%d", SM_iFirstScore); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Round 1 Bonus: {olive}%d", SM_iFirstScore); + + if (SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { + //PrintToChatAll("\x01[\x05Confogl\x01] Custom Max Distance: \x04%d", GetCustomMapMaxScore()); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Custom Max Distance: {olive}%d", GetCustomMapMaxScore()); + } + } else if (SM_bIsSecondRoundStarted && !SM_bIsSecondRoundOver) { + SM_bIsSecondRoundOver = true; + // Second round has ended, print scores + + int iAliveCount; + int iScore = RoundToFloor(SM_CalculateAvgHealth(iAliveCount) * SM_fMapMulti * SM_fHBRatio + 400 * SM_fMapMulti * SM_fSurvivalBonusRatio * iAliveCount / 4.0); + // If the score is nonzero, trust the SurvivalBonus var. + iScore = (iScore) ? (SM_hSurvivalBonus.IntValue * iAliveCount) : 0; + + //PrintToChatAll("\x01[\x05Confogl\x01] Round 1 Bonus: \x04%d", SM_iFirstScore); + //PrintToChatAll("\x01[\x05Confogl\x01] Round 2 Bonus: \x04%d", iScore); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Round 1 Bonus: {olive}%d", SM_iFirstScore); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Round 2 Bonus: {olive}%d", iScore); + + if (SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { + //PrintToChatAll("\x01[\x05Confogl\x01] Custom Max Distance: \x04%d", GetCustomMapMaxScore()); + CPrintToChatAll("{blue}[{default}Confogl{blue}]{default} Custom Max Distance: {olive}%d", GetCustomMapMaxScore()); + } + } } public void SM_RoundStart_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!SM_bModuleIsEnabled || !IsPluginEnabled() || !SM_bIsFirstRoundOver) { - return; - } + if (!SM_bModuleIsEnabled || !IsPluginEnabled() || !SM_bIsFirstRoundOver) { + return; + } - // Mark the beginning of the second round. - SM_bIsSecondRoundStarted = true; + // Mark the beginning of the second round. + SM_bIsSecondRoundStarted = true; } public void SM_FinaleVehicleLeaving_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { - return; - } + if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { + return; + } - SM_hSurvivalBonus.SetInt(SM_CalculateSurvivalBonus()); + SM_hSurvivalBonus.SetInt(SM_CalculateSurvivalBonus()); } public Action SM_Cmd_Health(int client, int args) { - if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { - return Plugin_Handled; - } - - int iAliveCount; - float fAvgHealth = SM_CalculateAvgHealth(iAliveCount); - - if (SM_bIsSecondRoundStarted) { - //PrintToChat(client, "\x01[\x05Confogl\x01] Round 1 Bonus: \x04%d", SM_iFirstScore); - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Round 1 Bonus: {olive}%d", SM_iFirstScore); - } - - if (client) { - //PrintToChat(client, "\x01[\x05Confogl\x01] Average Health: \x04%.02f", fAvgHealth); - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Average Health: {olive}%.02f", fAvgHealth); - } else { - PrintToServer("[Confogl] Average Health: %.02f", fAvgHealth); - } - - int iScore = RoundToFloor(fAvgHealth * SM_fMapMulti * SM_fHBRatio) * iAliveCount; - - if (DEBUG_SM || IsDebugEnabled()) { - LogMessage("[%s] CalcScore: %d MapMulti: %.02f Multiplier %.02f", SM_MODULE_NAME, iScore, SM_fMapMulti, SM_fHBRatio); - } - - if (client) { - //PrintToChat(client, "\x01[\x05Confogl\x01] Health Bonus: \x04%d", iScore); - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Health Bonus: {olive}%d", iScore); - - if (SM_fSurvivalBonusRatio != 0.0) { - //PrintToChat(client, "\x01[\x05Confogl\x01] Static Survival Bonus Per Survivor: \x04%d", RoundToFloor(400 * SM_fMapMulti * SM_fSurvivalBonusRatio)); - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Static Survival Bonus Per Survivor: {olive}%d", RoundToFloor(400 * SM_fMapMulti * SM_fSurvivalBonusRatio)); - } - - if (SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { - //PrintToChat(client, "\x01[\x05Confogl\x01] Custom Max Distance: \x04%d", GetCustomMapMaxScore()); - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Custom Max Distance: {olive}%d", GetCustomMapMaxScore()); - } - } else { - PrintToServer("[Confogl] Health Bonus: %d", iScore); - - if (SM_fSurvivalBonusRatio != 0.0) { - PrintToServer("[Confogl] Static Survival Bonus Per Survivor: %d", RoundToFloor(400 * SM_fMapMulti * SM_fSurvivalBonusRatio)); - } - - if (SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { - PrintToServer("[Confogl] Custom Max Distance: %d", GetCustomMapMaxScore()); - } - } - - return Plugin_Handled; + if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { + return Plugin_Handled; + } + + int iAliveCount; + float fAvgHealth = SM_CalculateAvgHealth(iAliveCount); + + if (SM_bIsSecondRoundStarted) { + //PrintToChat(client, "\x01[\x05Confogl\x01] Round 1 Bonus: \x04%d", SM_iFirstScore); + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Round 1 Bonus: {olive}%d", SM_iFirstScore); + } + + if (client) { + //PrintToChat(client, "\x01[\x05Confogl\x01] Average Health: \x04%.02f", fAvgHealth); + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Average Health: {olive}%.02f", fAvgHealth); + } else { + PrintToServer("[Confogl] Average Health: %.02f", fAvgHealth); + } + + int iScore = RoundToFloor(fAvgHealth * SM_fMapMulti * SM_fHBRatio) * iAliveCount; + + if (DEBUG_SM || IsDebugEnabled()) { + LogMessage("[%s] CalcScore: %d MapMulti: %.02f Multiplier %.02f", SM_MODULE_NAME, iScore, SM_fMapMulti, SM_fHBRatio); + } + + if (client) { + //PrintToChat(client, "\x01[\x05Confogl\x01] Health Bonus: \x04%d", iScore); + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Health Bonus: {olive}%d", iScore); + + if (SM_fSurvivalBonusRatio != 0.0) { + //PrintToChat(client, "\x01[\x05Confogl\x01] Static Survival Bonus Per Survivor: \x04%d", RoundToFloor(400 * SM_fMapMulti * SM_fSurvivalBonusRatio)); + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Static Survival Bonus Per Survivor: {olive}%d", RoundToFloor(400 * SM_fMapMulti * SM_fSurvivalBonusRatio)); + } + + if (SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { + //PrintToChat(client, "\x01[\x05Confogl\x01] Custom Max Distance: \x04%d", GetCustomMapMaxScore()); + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Custom Max Distance: {olive}%d", GetCustomMapMaxScore()); + } + } else { + PrintToServer("[Confogl] Health Bonus: %d", iScore); + + if (SM_fSurvivalBonusRatio != 0.0) { + PrintToServer("[Confogl] Static Survival Bonus Per Survivor: %d", RoundToFloor(400 * SM_fMapMulti * SM_fSurvivalBonusRatio)); + } + + if (SM_hCustomMaxDistance.BoolValue && GetCustomMapMaxScore() > -1) { + PrintToServer("[Confogl] Custom Max Distance: %d", GetCustomMapMaxScore()); + } + } + + return Plugin_Handled; } static float SM_CalculateAvgHealth(int &iAliveCount = 0) { - // Temporary Storage Variables for inventory - char strTemp[MAX_ENTITY_NAME_LENGTH]; - - int iTotalHealth, iTotalTempHealth[3], iTemp; - int iCurrHealth, iCurrTemp, iIncapCount, iSurvCount; - - float fTotalAdjustedTempHealth; - - bool IsFinale = L4D_IsMissionFinalMap(); - - iAliveCount = 0; - - for (int index = 1; index <= MaxClients; index++) { - if (IsSurvivor(index)) { - iSurvCount++; - if (IsPlayerAlive(index)) { - if (GetEntProp(index, Prop_Send, "m_isIncapacitated", 1) < 1) { - - // Get Main health stats - iCurrHealth = GetSurvivorPermanentHealth(index); - iCurrTemp = GetSurvivorTempHealth(index); - iIncapCount = GetSurvivorIncapCount(index); - - // Adjust for kits - iTemp = GetPlayerWeaponSlot(index, L4D2WeaponSlot_HeavyHealthItem); - if (iTemp > -1) { - GetEdictClassname(iTemp, strTemp, sizeof(strTemp)); - - if (strcmp(strTemp, "weapon_first_aid_kit") == 0) { - iCurrHealth = RoundToFloor(iCurrHealth + ((100 - iCurrHealth) * SM_fHealPercent)); - iCurrTemp = 0; - iIncapCount = 0; - } - } - - // Adjust for pills/adrenaline - iTemp = GetPlayerWeaponSlot(index, L4D2WeaponSlot_LightHealthItem); - if (iTemp > -1) { - GetEdictClassname(iTemp, strTemp, sizeof(strTemp)); - - if (strcmp(strTemp, "weapon_pain_pills") == 0) { - iCurrTemp += SM_iPillPercent; - } else if (strcmp(strTemp, "weapon_adrenaline") == 0) { - iCurrTemp += SM_iAdrenPercent; - } - } - - // Enforce max 100 total health points - if ((iCurrTemp + iCurrHealth) > 100) { - iCurrTemp = 100 - iCurrHealth; - } - - iAliveCount++; - iTotalHealth += iCurrHealth; - - if (iIncapCount < 0) { - iIncapCount = 0; - } else if (iIncapCount > 2) { - iIncapCount = 2; - } - - iTotalTempHealth[iIncapCount] += iCurrTemp; - } else if (!IsFinale) { - iAliveCount++; - } - } - } - } - - for (int i = 0; i < 3; i++) { - fTotalAdjustedTempHealth += iTotalTempHealth[i] * SM_fTempMulti[i]; - } - - // Total Score = Average Health points * numAlive - - // Average Health points = Total Health Points / Survivor Count - // Total Health Points = Total Permanent Health + Total Adjusted Temp Health - - // return Average Health Points - float fAvgHealth = (iTotalHealth + fTotalAdjustedTempHealth) / iSurvCount; + // Temporary Storage Variables for inventory + char strTemp[MAX_ENTITY_NAME_LENGTH]; + + int iTotalHealth, iTotalTempHealth[3], iTemp; + int iCurrHealth, iCurrTemp, iIncapCount, iSurvCount; + + float fTotalAdjustedTempHealth; + + bool IsFinale = L4D_IsMissionFinalMap(); + + iAliveCount = 0; + + for (int index = 1; index <= MaxClients; index++) { + if (IsSurvivor(index)) { + iSurvCount++; + if (IsPlayerAlive(index)) { + if (GetEntProp(index, Prop_Send, "m_isIncapacitated", 1) < 1) { + + // Get Main health stats + iCurrHealth = GetSurvivorPermanentHealth(index); + iCurrTemp = GetSurvivorTempHealth(index); + iIncapCount = GetSurvivorIncapCount(index); + + // Adjust for kits + iTemp = GetPlayerWeaponSlot(index, L4D2WeaponSlot_HeavyHealthItem); + if (iTemp > -1) { + GetEdictClassname(iTemp, strTemp, sizeof(strTemp)); + + if (strcmp(strTemp, "weapon_first_aid_kit") == 0) { + iCurrHealth = RoundToFloor(iCurrHealth + ((100 - iCurrHealth) * SM_fHealPercent)); + iCurrTemp = 0; + iIncapCount = 0; + } + } + + // Adjust for pills/adrenaline + iTemp = GetPlayerWeaponSlot(index, L4D2WeaponSlot_LightHealthItem); + if (iTemp > -1) { + GetEdictClassname(iTemp, strTemp, sizeof(strTemp)); + + if (strcmp(strTemp, "weapon_pain_pills") == 0) { + iCurrTemp += SM_iPillPercent; + } else if (strcmp(strTemp, "weapon_adrenaline") == 0) { + iCurrTemp += SM_iAdrenPercent; + } + } + + // Enforce max 100 total health points + if ((iCurrTemp + iCurrHealth) > 100) { + iCurrTemp = 100 - iCurrHealth; + } + + iAliveCount++; + iTotalHealth += iCurrHealth; + + if (iIncapCount < 0) { + iIncapCount = 0; + } else if (iIncapCount > 2) { + iIncapCount = 2; + } + + iTotalTempHealth[iIncapCount] += iCurrTemp; + } else if (!IsFinale) { + iAliveCount++; + } + } + } + } + + for (int i = 0; i < 3; i++) { + fTotalAdjustedTempHealth += iTotalTempHealth[i] * SM_fTempMulti[i]; + } + + // Total Score = Average Health points * numAlive + + // Average Health points = Total Health Points / Survivor Count + // Total Health Points = Total Permanent Health + Total Adjusted Temp Health + + // return Average Health Points + float fAvgHealth = (iTotalHealth + fTotalAdjustedTempHealth) / iSurvCount; #if DEBUG_SM - LogMessage("[%s] TotalPerm: %d TotalAdjustedTemp: %.02f SurvCount: %d AliveCount: %d AvgHealth: %.02f", \ - SM_MODULE_NAME, iTotalHealth, fTotalAdjustedTempHealth, iSurvCount, iAliveCount, fAvgHealth); + LogMessage("[%s] TotalPerm: %d TotalAdjustedTemp: %.02f SurvCount: %d AliveCount: %d AvgHealth: %.02f", \ + SM_MODULE_NAME, iTotalHealth, fTotalAdjustedTempHealth, iSurvCount, iAliveCount, fAvgHealth); #endif - return fAvgHealth; + return fAvgHealth; } /*public Action SM_Command_Say(int iClient, const char[] sCommand, int iArgc) { - if (iClient == 0 || !SM_bModuleIsEnabled || !IsPluginEnabled()) { - return Plugin_Continue; - } + if (iClient == 0 || !SM_bModuleIsEnabled || !IsPluginEnabled()) { + return Plugin_Continue; + } - char sMessage[MAX_NAME_LENGTH]; - GetCmdArg(1, sMessage, sizeof(sMessage)); + char sMessage[MAX_NAME_LENGTH]; + GetCmdArg(1, sMessage, sizeof(sMessage)); - if (strcmp(sMessage, "!health") == 0) { - return Plugin_Handled; - } + if (strcmp(sMessage, "!health") == 0) { + return Plugin_Handled; + } - return Plugin_Continue; + return Plugin_Continue; }*/ static int SM_CalculateSurvivalBonus() { - return RoundToFloor(SM_CalculateAvgHealth() * SM_fMapMulti * SM_fHBRatio + 400 * SM_fMapMulti * SM_fSurvivalBonusRatio); + return RoundToFloor(SM_CalculateAvgHealth() * SM_fMapMulti * SM_fHBRatio + 400 * SM_fMapMulti * SM_fSurvivalBonusRatio); } static int SM_CalculateScore() { - int iAliveCount = 0; - float fScore = SM_CalculateAvgHealth(iAliveCount); + int iAliveCount = 0; + float fScore = SM_CalculateAvgHealth(iAliveCount); - return RoundToFloor(fScore * SM_fMapMulti * SM_fHBRatio + 400 * SM_fMapMulti * SM_fSurvivalBonusRatio) * iAliveCount; + return RoundToFloor(fScore * SM_fMapMulti * SM_fHBRatio + 400 * SM_fMapMulti * SM_fSurvivalBonusRatio) * iAliveCount; } public int Native_IsScoremodEnabled(Handle plugin, int numParams) { - return (SM_bModuleIsEnabled && IsPluginEnabled()); + return (SM_bModuleIsEnabled && IsPluginEnabled()); } public int Native_GetScoremodBonus(Handle plugin, int numParams) { - if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { - return -1; - } + if (!SM_bModuleIsEnabled || !IsPluginEnabled()) { + return -1; + } - return SM_CalculateScore(); + return SM_CalculateScore(); } diff --git a/addons/sourcemod/scripting/confoglcompmod/UnprohibitBosses.sp b/addons/sourcemod/scripting/confoglcompmod/UnprohibitBosses.sp index 41d334c70..b8543eb62 100644 --- a/addons/sourcemod/scripting/confoglcompmod/UnprohibitBosses.sp +++ b/addons/sourcemod/scripting/confoglcompmod/UnprohibitBosses.sp @@ -1,58 +1,58 @@ #if defined __unprohibit_bosses_included - #endinput + #endinput #endif #define __unprohibit_bosses_included -#define UB_MODULE_NAME "UnprohibitBosses" +#define UB_MODULE_NAME "UnprohibitBosses" static bool - UB_bEnabled = true; + UB_bEnabled = true; static ConVar - UB_hEnable = null; + UB_hEnable = null; void UB_OnModuleStart() { - UB_hEnable = CreateConVarEx("boss_unprohibit", "1", "Enable bosses spawning on all maps, even through they normally aren't allowed", _, true, 0.0, true, 1.0); + UB_hEnable = CreateConVarEx("boss_unprohibit", "1", "Enable bosses spawning on all maps, even through they normally aren't allowed", _, true, 0.0, true, 1.0); - UB_bEnabled = UB_hEnable.BoolValue; //turns on when changing cvar only - UB_hEnable.AddChangeHook(UB_ConVarChange); + UB_bEnabled = UB_hEnable.BoolValue; //turns on when changing cvar only + UB_hEnable.AddChangeHook(UB_ConVarChange); } public void UB_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - UB_bEnabled = UB_hEnable.BoolValue; + UB_bEnabled = UB_hEnable.BoolValue; } Action UB_OnGetScriptValueInt(const char[] key, int &retVal) { - if (IsPluginEnabled() && UB_bEnabled) { - if (strcmp(key, "DisallowThreatType") == 0) { - retVal = 0; - return Plugin_Handled; - } - - if (strcmp(key, "ProhibitBosses") == 0) { - retVal = 0; - return Plugin_Handled; - } - } - - return Plugin_Continue; + if (IsPluginEnabled() && UB_bEnabled) { + if (strcmp(key, "DisallowThreatType") == 0) { + retVal = 0; + return Plugin_Handled; + } + + if (strcmp(key, "ProhibitBosses") == 0) { + retVal = 0; + return Plugin_Handled; + } + } + + return Plugin_Continue; } Action UB_OnGetMissionVSBossSpawning() { - //if (IsPluginEnabled() && UB_bEnabled) { - if (UB_bEnabled) { - char mapbuf[32]; - GetCurrentMap(mapbuf, sizeof(mapbuf)); - if (strcmp(mapbuf, "c7m1_docks") == 0 || strcmp(mapbuf, "c13m2_southpinestream") == 0) { - return Plugin_Continue; - } - - return Plugin_Handled; - } - - return Plugin_Continue; + //if (IsPluginEnabled() && UB_bEnabled) { + if (UB_bEnabled) { + char mapbuf[32]; + GetCurrentMap(mapbuf, sizeof(mapbuf)); + if (strcmp(mapbuf, "c7m1_docks") == 0 || strcmp(mapbuf, "c13m2_southpinestream") == 0) { + return Plugin_Continue; + } + + return Plugin_Handled; + } + + return Plugin_Continue; } diff --git a/addons/sourcemod/scripting/confoglcompmod/UnreserveLobby.sp b/addons/sourcemod/scripting/confoglcompmod/UnreserveLobby.sp index 650356a3a..4ba51ce74 100644 --- a/addons/sourcemod/scripting/confoglcompmod/UnreserveLobby.sp +++ b/addons/sourcemod/scripting/confoglcompmod/UnreserveLobby.sp @@ -1,36 +1,36 @@ #if defined __unreserve_lobby_included - #endinput + #endinput #endif #define __unreserve_lobby_included -#define UL_MODULE_NAME "UnreserveLobby" +#define UL_MODULE_NAME "UnreserveLobby" static ConVar - UL_hEnable = null; + UL_hEnable = null; void UL_OnModuleStart() { - UL_hEnable = CreateConVarEx("match_killlobbyres", "1", \ - "Sets whether the plugin will clear lobby reservation once a match have begun", \ - _, true, 0.0, true, 1.0 \ - ); + UL_hEnable = CreateConVarEx("match_killlobbyres", "1", \ + "Sets whether the plugin will clear lobby reservation once a match have begun", \ + _, true, 0.0, true, 1.0 \ + ); - RegAdminCmd("sm_killlobbyres", UL_KillLobbyRes, ADMFLAG_BAN, "Forces the plugin to kill lobby reservation"); + RegAdminCmd("sm_killlobbyres", UL_KillLobbyRes, ADMFLAG_BAN, "Forces the plugin to kill lobby reservation"); } void UL_OnClientPutInServer() { - if (!IsPluginEnabled() || !UL_hEnable.BoolValue) { - return; - } + if (!IsPluginEnabled() || !UL_hEnable.BoolValue) { + return; + } - L4D_LobbyUnreserve(); + L4D_LobbyUnreserve(); } public Action UL_KillLobbyRes(int client, int args) { - L4D_LobbyUnreserve(); - ReplyToCommand(client, "[Confogl] Removed lobby reservation."); + L4D_LobbyUnreserve(); + ReplyToCommand(client, "[Confogl] Removed lobby reservation."); - return Plugin_Handled; + return Plugin_Handled; } diff --git a/addons/sourcemod/scripting/confoglcompmod/WaterSlowdown.sp b/addons/sourcemod/scripting/confoglcompmod/WaterSlowdown.sp index ad5565270..1ead1be38 100644 --- a/addons/sourcemod/scripting/confoglcompmod/WaterSlowdown.sp +++ b/addons/sourcemod/scripting/confoglcompmod/WaterSlowdown.sp @@ -1,125 +1,125 @@ #if defined __water_slowdown_included - #endinput + #endinput #endif #define __water_slowdown_included -#define WS_MODULE_NAME "WaterSlowdown" +#define WS_MODULE_NAME "WaterSlowdown" static float - WS_fSlowdownFactor = 0.90; + WS_fSlowdownFactor = 0.90; static bool - WS_bEnabled = true, - WS_bJockeyInWater = false, - WS_bPlayerInWater[MAXPLAYERS + 1] = {false, ...}; + WS_bEnabled = true, + WS_bJockeyInWater = false, + WS_bPlayerInWater[MAXPLAYERS + 1] = {false, ...}; static ConVar - WS_hEnable = null, - WS_hFactor = null; + WS_hEnable = null, + WS_hFactor = null; void WS_OnModuleStart() { - WS_hEnable = CreateConVarEx("waterslowdown", "1", "Enables additional water slowdown", _, true, 0.0, true, 1.0); - WS_hFactor = CreateConVarEx("slowdown_factor", "0.90", "Sets how much water will slow down survivors. 1.00 = Vanilla"); + WS_hEnable = CreateConVarEx("waterslowdown", "1", "Enables additional water slowdown", _, true, 0.0, true, 1.0); + WS_hFactor = CreateConVarEx("slowdown_factor", "0.90", "Sets how much water will slow down survivors. 1.00 = Vanilla"); - WS_SetStatus(); - WS_fSlowdownFactor = WS_hFactor.FloatValue; + WS_SetStatus(); + WS_fSlowdownFactor = WS_hFactor.FloatValue; - WS_hEnable.AddChangeHook(WS_ConVarChange); - WS_hFactor.AddChangeHook(WS_FactorConVarChange); + WS_hEnable.AddChangeHook(WS_ConVarChange); + WS_hFactor.AddChangeHook(WS_FactorConVarChange); - HookEvent("round_start", WS_RoundStart, EventHookMode_PostNoCopy); - HookEvent("jockey_ride", WS_JockeyRide); - HookEvent("jockey_ride_end", WS_JockeyRideEnd); + HookEvent("round_start", WS_RoundStart, EventHookMode_PostNoCopy); + HookEvent("jockey_ride", WS_JockeyRide); + HookEvent("jockey_ride_end", WS_JockeyRideEnd); } public void WS_FactorConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - WS_fSlowdownFactor = WS_hFactor.FloatValue; + WS_fSlowdownFactor = WS_hFactor.FloatValue; } public void WS_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - WS_SetStatus(); + WS_SetStatus(); } void WS_OnMapEnd() { - WS_SetStatus(false); + WS_SetStatus(false); } void WS_OnModuleEnd() { - WS_SetStatus(false); + WS_SetStatus(false); } void WS_OnGameFrame() { - if (!IsServerProcessing() || !IsPluginEnabled() || !WS_bEnabled) { - return; - } - - int client, flags; - - for (int i = 0; i < NUM_OF_SURVIVORS; i++) { - client = GetSurvivorIndex(i); - - if (client != 0 && IsValidEntity(client)) { - flags = GetEntityFlags(client); - - if (!(flags & IN_JUMP && WS_bPlayerInWater[client])) { - if (flags & FL_INWATER) { - if (!WS_bPlayerInWater[client]) { - WS_bPlayerInWater[client] = true; - SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", WS_fSlowdownFactor); - } - } else { - if (WS_bPlayerInWater[client]) { - WS_bPlayerInWater[client] = false; - SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 1.0); - } - } - } - } - } + if (!IsServerProcessing() || !IsPluginEnabled() || !WS_bEnabled) { + return; + } + + int client, flags; + + for (int i = 0; i < NUM_OF_SURVIVORS; i++) { + client = GetSurvivorIndex(i); + + if (client != 0 && IsValidEntity(client)) { + flags = GetEntityFlags(client); + + if (!(flags & IN_JUMP && WS_bPlayerInWater[client])) { + if (flags & FL_INWATER) { + if (!WS_bPlayerInWater[client]) { + WS_bPlayerInWater[client] = true; + SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", WS_fSlowdownFactor); + } + } else { + if (WS_bPlayerInWater[client]) { + WS_bPlayerInWater[client] = false; + SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 1.0); + } + } + } + } + } } public void WS_RoundStart(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - WS_SetStatus(); + WS_SetStatus(); } public void WS_JockeyRide(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - int victim = GetClientOfUserId(hEvent.GetInt("victim")); - int jockey = GetClientOfUserId(hEvent.GetInt("userid")); - - if (WS_bPlayerInWater[victim] && !WS_bJockeyInWater) { - WS_bJockeyInWater = true; - SetEntPropFloat(jockey, Prop_Send, "m_flLaggedMovementValue", WS_fSlowdownFactor); - } else if (!WS_bPlayerInWater[victim] && WS_bJockeyInWater) { - WS_bJockeyInWater = false; - SetEntPropFloat(jockey, Prop_Send, "m_flLaggedMovementValue", 1.0); - } + int victim = GetClientOfUserId(hEvent.GetInt("victim")); + int jockey = GetClientOfUserId(hEvent.GetInt("userid")); + + if (WS_bPlayerInWater[victim] && !WS_bJockeyInWater) { + WS_bJockeyInWater = true; + SetEntPropFloat(jockey, Prop_Send, "m_flLaggedMovementValue", WS_fSlowdownFactor); + } else if (!WS_bPlayerInWater[victim] && WS_bJockeyInWater) { + WS_bJockeyInWater = false; + SetEntPropFloat(jockey, Prop_Send, "m_flLaggedMovementValue", 1.0); + } } public void WS_JockeyRideEnd(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - int jockey = GetClientOfUserId(hEvent.GetInt("userid")); + int jockey = GetClientOfUserId(hEvent.GetInt("userid")); - WS_bJockeyInWater = false; + WS_bJockeyInWater = false; - if (jockey > 0 && IsValidEntity(jockey)) { - SetEntPropFloat(jockey, Prop_Send, "m_flLaggedMovementValue", 1.0); - } + if (jockey > 0 && IsValidEntity(jockey)) { + SetEntPropFloat(jockey, Prop_Send, "m_flLaggedMovementValue", 1.0); + } } static void WS_SetStatus(bool bEnable = true) { - if (!bEnable) { - WS_bEnabled = false; - return; - } + if (!bEnable) { + WS_bEnabled = false; + return; + } - WS_bEnabled = WS_hEnable.BoolValue; + WS_bEnabled = WS_hEnable.BoolValue; } diff --git a/addons/sourcemod/scripting/confoglcompmod/WeaponCustomization.sp b/addons/sourcemod/scripting/confoglcompmod/WeaponCustomization.sp index 769222f87..4c06909b0 100644 --- a/addons/sourcemod/scripting/confoglcompmod/WeaponCustomization.sp +++ b/addons/sourcemod/scripting/confoglcompmod/WeaponCustomization.sp @@ -1,132 +1,132 @@ #if defined __weapon_customization_included - #endinput + #endinput #endif #define __weapon_customization_included -#define WC_MODULE_NAME "WeaponCustomization" +#define WC_MODULE_NAME "WeaponCustomization" static const char sSniperNames[][] = { - "weapon_hunting_rifle", - "weapon_sniper_military", - "weapon_sniper_awp", - "weapon_sniper_scout", - "weapon_rifle_sg552" + "weapon_hunting_rifle", + "weapon_sniper_military", + "weapon_sniper_awp", + "weapon_sniper_scout", + "weapon_rifle_sg552" }; static char - WC_sLastWeapon[64] = "\0"; + WC_sLastWeapon[64] = "\0"; static int - WC_iLimitCount = 1, - WC_iLastWeapon = -1, - WC_iLastClient = -1; + WC_iLimitCount = 1, + WC_iLastWeapon = -1, + WC_iLastClient = -1; static ConVar - WC_hLimitCount = null; + WC_hLimitCount = null; void WC_OnModuleStart() { - WC_hLimitCount = CreateConVarEx("limit_sniper", "1", "Limits the maximum number of sniping rifles at one time to this number", _, true, 0.0, true, 4.0); + WC_hLimitCount = CreateConVarEx("limit_sniper", "1", "Limits the maximum number of sniping rifles at one time to this number", _, true, 0.0, true, 4.0); - WC_iLimitCount = WC_hLimitCount.IntValue; - WC_hLimitCount.AddChangeHook(WC_ConVarChange); + WC_iLimitCount = WC_hLimitCount.IntValue; + WC_hLimitCount.AddChangeHook(WC_ConVarChange); - HookEvent("player_use", WC_PlayerUse_Event); - HookEvent("weapon_drop", WC_WeaponDrop_Event); + HookEvent("player_use", WC_PlayerUse_Event); + HookEvent("weapon_drop", WC_WeaponDrop_Event); } public void WC_ConVarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - WC_iLimitCount = WC_hLimitCount.IntValue; + WC_iLimitCount = WC_hLimitCount.IntValue; } public void WC_WeaponDrop_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!IsPluginEnabled()) { - return; - } + if (!IsPluginEnabled()) { + return; + } - WC_iLastWeapon = hEvent.GetInt("propid"); - WC_iLastClient = GetClientOfUserId(hEvent.GetInt("userid")); - hEvent.GetString("item", WC_sLastWeapon, sizeof(WC_sLastWeapon)); + WC_iLastWeapon = hEvent.GetInt("propid"); + WC_iLastClient = GetClientOfUserId(hEvent.GetInt("userid")); + hEvent.GetString("item", WC_sLastWeapon, sizeof(WC_sLastWeapon)); } public void WC_PlayerUse_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!IsPluginEnabled()) { - return; - } - - int client = GetClientOfUserId(hEvent.GetInt("userid")); - - int primary = GetPlayerWeaponSlot(client, L4D2WeaponSlot_Primary); - if (primary < 1 || !IsValidEdict(primary)) { - return; - } - - char primary_name[MAX_ENTITY_NAME_LENGTH]; - GetEdictClassname(primary, primary_name, sizeof(primary_name)); - - if (IsValidSniper(primary_name)) { - if (SniperCount(client) >= WC_iLimitCount) { - RemovePlayerItem(client, primary); - //PrintToChat(client, "\x01[\x05Confogl\x01] Maximum \x04%d \x01sniping rifle(s) is enforced.", WC_iLimitCount); - CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Maximum {blue}%d {olive}sniping rifle(s) {default}is enforced.", WC_iLimitCount); - - if (WC_iLastClient == client) { - if (WC_iLastWeapon > 0 && IsValidEdict(WC_iLastWeapon)) { - KillEntity(WC_iLastWeapon); - - int flags = GetCommandFlags("give"); - SetCommandFlags("give", flags ^ FCVAR_CHEAT); - - char sTemp[64]; - Format(sTemp, sizeof(sTemp), "give %s", WC_sLastWeapon); - FakeClientCommand(client, sTemp); - - SetCommandFlags("give", flags); - } - } - } - } - - WC_iLastWeapon = -1; - WC_iLastClient = -1; - WC_sLastWeapon[0] = 0; + if (!IsPluginEnabled()) { + return; + } + + int client = GetClientOfUserId(hEvent.GetInt("userid")); + + int primary = GetPlayerWeaponSlot(client, L4D2WeaponSlot_Primary); + if (primary < 1 || !IsValidEdict(primary)) { + return; + } + + char primary_name[MAX_ENTITY_NAME_LENGTH]; + GetEdictClassname(primary, primary_name, sizeof(primary_name)); + + if (IsValidSniper(primary_name)) { + if (SniperCount(client) >= WC_iLimitCount) { + RemovePlayerItem(client, primary); + //PrintToChat(client, "\x01[\x05Confogl\x01] Maximum \x04%d \x01sniping rifle(s) is enforced.", WC_iLimitCount); + CPrintToChat(client, "{blue}[{default}Confogl{blue}]{default} Maximum {blue}%d {olive}sniping rifle(s) {default}is enforced.", WC_iLimitCount); + + if (WC_iLastClient == client) { + if (WC_iLastWeapon > 0 && IsValidEdict(WC_iLastWeapon)) { + KillEntity(WC_iLastWeapon); + + int flags = GetCommandFlags("give"); + SetCommandFlags("give", flags ^ FCVAR_CHEAT); + + char sTemp[64]; + Format(sTemp, sizeof(sTemp), "give %s", WC_sLastWeapon); + FakeClientCommand(client, sTemp); + + SetCommandFlags("give", flags); + } + } + } + } + + WC_iLastWeapon = -1; + WC_iLastClient = -1; + WC_sLastWeapon[0] = 0; } static int SniperCount(int client) { - char temp[MAX_ENTITY_NAME_LENGTH]; - int count = 0, index = 0, ent = 0; + char temp[MAX_ENTITY_NAME_LENGTH]; + int count = 0, index = 0, ent = 0; - for (int i = 0; i < 4; i++) { - index = GetSurvivorIndex(i); + for (int i = 0; i < 4; i++) { + index = GetSurvivorIndex(i); - if (index != client && index != 0 && IsClientConnected(index)) { - ent = GetPlayerWeaponSlot(index, L4D2WeaponSlot_Primary); + if (index != client && index != 0 && IsClientConnected(index)) { + ent = GetPlayerWeaponSlot(index, L4D2WeaponSlot_Primary); - if (ent > 0 && IsValidEdict(ent)) { - GetEdictClassname(ent, temp, sizeof(temp)); + if (ent > 0 && IsValidEdict(ent)) { + GetEdictClassname(ent, temp, sizeof(temp)); - if (IsValidSniper(temp)) { - count++; - } - } - } - } + if (IsValidSniper(temp)) { + count++; + } + } + } + } - return count; + return count; } static bool IsValidSniper(const char[] sWeaponName) { - for (int i = 0; i < sizeof(sSniperNames); i++) { - if (strcmp(sWeaponName, sSniperNames[i], true) == 0) { - return true; - } - } + for (int i = 0; i < sizeof(sSniperNames); i++) { + if (strcmp(sWeaponName, sSniperNames[i], true) == 0) { + return true; + } + } - return false; + return false; } diff --git a/addons/sourcemod/scripting/confoglcompmod/WeaponInformation.sp b/addons/sourcemod/scripting/confoglcompmod/WeaponInformation.sp index 933a6cc3f..d10963fc2 100644 --- a/addons/sourcemod/scripting/confoglcompmod/WeaponInformation.sp +++ b/addons/sourcemod/scripting/confoglcompmod/WeaponInformation.sp @@ -1,572 +1,572 @@ #if defined __weapon_information_included - #endinput + #endinput #endif #define __weapon_information_included -#define DEBUG_WI 0 +#define DEBUG_WI 0 #if (DEBUG_ALL) - #define DEBUG_WI 1 + #define DEBUG_WI 1 #endif -#define WI_MODULE_NAME "WepInfo" +#define WI_MODULE_NAME "WepInfo" -#define MODEL_PREFIX "models/w_models/weapons/w_" -#define MODEL_SURFIX ".mdl" -#define SPAWN_PREFIX "weapon_" -#define SPAWN_SURFIX "_spawn" +#define MODEL_PREFIX "models/w_models/weapons/w_" +#define MODEL_SURFIX ".mdl" +#define SPAWN_PREFIX "weapon_" +#define SPAWN_SURFIX "_spawn" //==================================================== // Weapon Index & ID //==================================================== -#define WEAPON_REMOVE_INDEX -1 -#define WEAPON_NULL_INDEX 0 - -#define WEAPON_SMG_ID 2 -#define WEAPON_SMG_INDEX 1 -#define WEAPON_PUMPSHOTGUN_ID 3 -#define WEAPON_PUMPSHOTGUN_INDEX 2 - -#define WEAPON_AUTOSHOTGUN_ID 4 -#define WEAPON_AUTOSHOTGUN_INDEX 3 -#define WEAPON_RIFLE_ID 5 -#define WEAPON_RIFLE_INDEX 4 - -#define WEAPON_HUNTING_RIFLE_ID 6 -#define WEAPON_HUNTING_RIFLE_INDEX 5 -#define WEAPON_SMG_SILENCED_ID 7 -#define WEAPON_SMG_SILENCED_INDEX 6 - -#define WEAPON_SHOTGUN_CHROME_ID 8 -#define WEAPON_SHOTGUN_CHROME_INDEX 7 -#define WEAPON_RIFLE_DESERT_ID 9 -#define WEAPON_RIFLE_DESERT_INDEX 8 - -#define WEAPON_SNIPER_MILITARY_ID 10 -#define WEAPON_SNIPER_MILITARY_INDEX 9 -#define WEAPON_SHOTGUN_SPAS_ID 11 -#define WEAPON_SHOTGUN_SPAS_INDEX 10 - -#define WEAPON_GRENADE_LAUNCHER_ID 21 -#define WEAPON_GRENADE_LAUNCHER_INDEX 11 -#define WEAPON_RIFLE_AK47_ID 26 -#define WEAPON_RIFLE_AK47_INDEX 12 - -#define WEAPON_RIFLE_M60_ID 37 -#define WEAPON_RIFLE_M60_INDEX 13 - -#define WEAPON_SMG_MP5_ID 33 -#define WEAPON_SMG_MP5_INDEX 14 -#define WEAPON_RIFLE_SG552_ID 34 -#define WEAPON_RIFLE_SG552_INDEX 15 - -#define WEAPON_SNIPER_AWP_ID 35 -#define WEAPON_SNIPER_AWP_INDEX 16 -#define WEAPON_SNIPER_SCOUT_ID 36 -#define WEAPON_SNIPER_SCOUT_INDEX 17 - -#define WEAPON_CHAINSAW_INDEX 18 - -#define WEAPON_PIPE_BOMB_INDEX 19 -#define WEAPON_MOLOTOV_INDEX 20 -#define WEAPON_VOMITJAR_INDEX 21 - -#define WEAPON_FIRST_AID_KIT_INDEX 22 -#define WEAPON_DEFIBRILLATOR_INDEX 23 -#define WEAPON_UPG_EXPLOSIVE_INDEX 24 -#define WEAPON_UPG_INCENDIARY_INDEX 25 - -#define WEAPON_PAIN_PILLS_INDEX 26 -#define WEAPON_ADRENALINE_INDEX 27 +#define WEAPON_REMOVE_INDEX -1 +#define WEAPON_NULL_INDEX 0 + +#define WEAPON_SMG_ID 2 +#define WEAPON_SMG_INDEX 1 +#define WEAPON_PUMPSHOTGUN_ID 3 +#define WEAPON_PUMPSHOTGUN_INDEX 2 + +#define WEAPON_AUTOSHOTGUN_ID 4 +#define WEAPON_AUTOSHOTGUN_INDEX 3 +#define WEAPON_RIFLE_ID 5 +#define WEAPON_RIFLE_INDEX 4 + +#define WEAPON_HUNTING_RIFLE_ID 6 +#define WEAPON_HUNTING_RIFLE_INDEX 5 +#define WEAPON_SMG_SILENCED_ID 7 +#define WEAPON_SMG_SILENCED_INDEX 6 + +#define WEAPON_SHOTGUN_CHROME_ID 8 +#define WEAPON_SHOTGUN_CHROME_INDEX 7 +#define WEAPON_RIFLE_DESERT_ID 9 +#define WEAPON_RIFLE_DESERT_INDEX 8 + +#define WEAPON_SNIPER_MILITARY_ID 10 +#define WEAPON_SNIPER_MILITARY_INDEX 9 +#define WEAPON_SHOTGUN_SPAS_ID 11 +#define WEAPON_SHOTGUN_SPAS_INDEX 10 + +#define WEAPON_GRENADE_LAUNCHER_ID 21 +#define WEAPON_GRENADE_LAUNCHER_INDEX 11 +#define WEAPON_RIFLE_AK47_ID 26 +#define WEAPON_RIFLE_AK47_INDEX 12 + +#define WEAPON_RIFLE_M60_ID 37 +#define WEAPON_RIFLE_M60_INDEX 13 + +#define WEAPON_SMG_MP5_ID 33 +#define WEAPON_SMG_MP5_INDEX 14 +#define WEAPON_RIFLE_SG552_ID 34 +#define WEAPON_RIFLE_SG552_INDEX 15 + +#define WEAPON_SNIPER_AWP_ID 35 +#define WEAPON_SNIPER_AWP_INDEX 16 +#define WEAPON_SNIPER_SCOUT_ID 36 +#define WEAPON_SNIPER_SCOUT_INDEX 17 + +#define WEAPON_CHAINSAW_INDEX 18 + +#define WEAPON_PIPE_BOMB_INDEX 19 +#define WEAPON_MOLOTOV_INDEX 20 +#define WEAPON_VOMITJAR_INDEX 21 + +#define WEAPON_FIRST_AID_KIT_INDEX 22 +#define WEAPON_DEFIBRILLATOR_INDEX 23 +#define WEAPON_UPG_EXPLOSIVE_INDEX 24 +#define WEAPON_UPG_INCENDIARY_INDEX 25 + +#define WEAPON_PAIN_PILLS_INDEX 26 +#define WEAPON_ADRENALINE_INDEX 27 //==================================================== -#define NUM_OF_WEAPONS 28 +#define NUM_OF_WEAPONS 28 -#define FIRST_WEAPON 1 -#define LAST_WEAPON 18 -#define FIRST_EXTRA 19 -#define LAST_EXTRA 27 +#define FIRST_WEAPON 1 +#define LAST_WEAPON 18 +#define FIRST_EXTRA 19 +#define LAST_EXTRA 27 -#define WEAPON_NUMBER_OF_START_KITS 4 +#define WEAPON_NUMBER_OF_START_KITS 4 enum /*WEAPONATTRIBUTES*/ { - WeaponID, - Tier1EquivalentIndex, - ReplacementIndex, + WeaponID, + Tier1EquivalentIndex, + ReplacementIndex, - WeaponAttributes_Size + WeaponAttributes_Size }; static const int Weapon_Attributes[NUM_OF_WEAPONS][WeaponAttributes_Size] = { - //==================================================== - // Weapons - //==================================================== - - // NULL - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // SMG - { - WEAPON_SMG_ID, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // Pumpshotgun - { - WEAPON_PUMPSHOTGUN_ID, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // Autoshotgun - { - WEAPON_AUTOSHOTGUN_ID, - WEAPON_PUMPSHOTGUN_INDEX, - WEAPON_NULL_INDEX - }, - - // Rifle - { - WEAPON_RIFLE_ID, - WEAPON_SMG_INDEX, - WEAPON_NULL_INDEX - }, - - // Hunting rifle - { - WEAPON_HUNTING_RIFLE_ID, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // SMG silenced - { - WEAPON_SMG_SILENCED_ID, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // Chrome shotgun - { - WEAPON_SHOTGUN_CHROME_ID, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // Desert rifle - { - WEAPON_RIFLE_DESERT_ID, - WEAPON_SMG_INDEX, - WEAPON_NULL_INDEX - }, - - // Military sniper - { - WEAPON_SNIPER_MILITARY_ID, - WEAPON_HUNTING_RIFLE_INDEX, - WEAPON_NULL_INDEX - }, - - // Spas shotgun - { - WEAPON_SHOTGUN_SPAS_ID, - WEAPON_SHOTGUN_CHROME_INDEX, - WEAPON_NULL_INDEX - }, - - // Grenade launcher - { - WEAPON_GRENADE_LAUNCHER_ID, - WEAPON_NULL_INDEX, - WEAPON_REMOVE_INDEX - }, - - // AK47 - { - WEAPON_RIFLE_AK47_ID, - WEAPON_SMG_SILENCED_INDEX, - WEAPON_NULL_INDEX - }, - - // M60 - { - WEAPON_RIFLE_M60_ID, - WEAPON_NULL_INDEX, - WEAPON_REMOVE_INDEX, - }, - - // MP5 - { - WEAPON_SMG_MP5_ID, - WEAPON_NULL_INDEX, - WEAPON_SMG_INDEX - }, - - // SG552 - { - WEAPON_RIFLE_SG552_ID, - WEAPON_SMG_MP5_INDEX, - WEAPON_RIFLE_INDEX - }, - - // AWP - { - WEAPON_SNIPER_AWP_ID, - WEAPON_SNIPER_SCOUT_INDEX, - WEAPON_SNIPER_MILITARY_INDEX - }, - - // Scout - { - WEAPON_SNIPER_SCOUT_ID, - WEAPON_NULL_INDEX, - WEAPON_HUNTING_RIFLE_INDEX - }, - - //==================================================== - // Melee Weapons - //==================================================== - - // Chainsaw - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_REMOVE_INDEX - }, - - //==================================================== - // Extra Items - //==================================================== - - // Pipe Bomb - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // Molotov - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // Vomitjar - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // First Aid Kit - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_REMOVE_INDEX - }, - - // Defibrillator - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_REMOVE_INDEX - }, - - // Explosive Upgrade Pack - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_REMOVE_INDEX - }, - - // Incendiary Upgrade Pack - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_REMOVE_INDEX - }, - - // Pain pills - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - }, - - // Adrenaline - { - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX, - WEAPON_NULL_INDEX - } + //==================================================== + // Weapons + //==================================================== + + // NULL + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // SMG + { + WEAPON_SMG_ID, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // Pumpshotgun + { + WEAPON_PUMPSHOTGUN_ID, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // Autoshotgun + { + WEAPON_AUTOSHOTGUN_ID, + WEAPON_PUMPSHOTGUN_INDEX, + WEAPON_NULL_INDEX + }, + + // Rifle + { + WEAPON_RIFLE_ID, + WEAPON_SMG_INDEX, + WEAPON_NULL_INDEX + }, + + // Hunting rifle + { + WEAPON_HUNTING_RIFLE_ID, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // SMG silenced + { + WEAPON_SMG_SILENCED_ID, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // Chrome shotgun + { + WEAPON_SHOTGUN_CHROME_ID, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // Desert rifle + { + WEAPON_RIFLE_DESERT_ID, + WEAPON_SMG_INDEX, + WEAPON_NULL_INDEX + }, + + // Military sniper + { + WEAPON_SNIPER_MILITARY_ID, + WEAPON_HUNTING_RIFLE_INDEX, + WEAPON_NULL_INDEX + }, + + // Spas shotgun + { + WEAPON_SHOTGUN_SPAS_ID, + WEAPON_SHOTGUN_CHROME_INDEX, + WEAPON_NULL_INDEX + }, + + // Grenade launcher + { + WEAPON_GRENADE_LAUNCHER_ID, + WEAPON_NULL_INDEX, + WEAPON_REMOVE_INDEX + }, + + // AK47 + { + WEAPON_RIFLE_AK47_ID, + WEAPON_SMG_SILENCED_INDEX, + WEAPON_NULL_INDEX + }, + + // M60 + { + WEAPON_RIFLE_M60_ID, + WEAPON_NULL_INDEX, + WEAPON_REMOVE_INDEX, + }, + + // MP5 + { + WEAPON_SMG_MP5_ID, + WEAPON_NULL_INDEX, + WEAPON_SMG_INDEX + }, + + // SG552 + { + WEAPON_RIFLE_SG552_ID, + WEAPON_SMG_MP5_INDEX, + WEAPON_RIFLE_INDEX + }, + + // AWP + { + WEAPON_SNIPER_AWP_ID, + WEAPON_SNIPER_SCOUT_INDEX, + WEAPON_SNIPER_MILITARY_INDEX + }, + + // Scout + { + WEAPON_SNIPER_SCOUT_ID, + WEAPON_NULL_INDEX, + WEAPON_HUNTING_RIFLE_INDEX + }, + + //==================================================== + // Melee Weapons + //==================================================== + + // Chainsaw + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_REMOVE_INDEX + }, + + //==================================================== + // Extra Items + //==================================================== + + // Pipe Bomb + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // Molotov + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // Vomitjar + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // First Aid Kit + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_REMOVE_INDEX + }, + + // Defibrillator + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_REMOVE_INDEX + }, + + // Explosive Upgrade Pack + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_REMOVE_INDEX + }, + + // Incendiary Upgrade Pack + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_REMOVE_INDEX + }, + + // Pain pills + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + }, + + // Adrenaline + { + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX, + WEAPON_NULL_INDEX + } }; static const char Weapon_Models[NUM_OF_WEAPONS][] = { - //==================================================== - // Weapons - //==================================================== + //==================================================== + // Weapons + //==================================================== - // NULL - "", + // NULL + "", - // SMG - "smg_uzi", + // SMG + "smg_uzi", - // Shotgun - "shotgun", + // Shotgun + "shotgun", - // Autoshotgun - "autoshot_m4super", + // Autoshotgun + "autoshot_m4super", - // Rifle - "rifle_m16a2", + // Rifle + "rifle_m16a2", - // Hunting rifle - "sniper_mini14", + // Hunting rifle + "sniper_mini14", - // SMG silenced - "smg_a", + // SMG silenced + "smg_a", - // Chrome shotgun - "pumpshotgun_a", + // Chrome shotgun + "pumpshotgun_a", - // Desert rifle - "rifle_b", + // Desert rifle + "rifle_b", - // Military rifle - "sniper_military", + // Military rifle + "sniper_military", - // Spas shotgun - "shotgun_spas", + // Spas shotgun + "shotgun_spas", - // Grenade launcher - "", + // Grenade launcher + "", - // AK47 - "rifle_ak47", + // AK47 + "rifle_ak47", - // M60 - "m60", + // M60 + "m60", - // MP5 - "smg_mp5", + // MP5 + "smg_mp5", - // SG552 - "", + // SG552 + "", - // AWP - "", + // AWP + "", - // Scout - "sniper_scout", + // Scout + "sniper_scout", - //==================================================== - // Melee Weapons - //==================================================== + //==================================================== + // Melee Weapons + //==================================================== - // Chainsaw - "", + // Chainsaw + "", - //==================================================== - // Extra Items - //==================================================== + //==================================================== + // Extra Items + //==================================================== - // Pipe Bomb - "", + // Pipe Bomb + "", - // Molotov - "", + // Molotov + "", - // Vomitjar - "", + // Vomitjar + "", - // First Aid Kit - "", + // First Aid Kit + "", - // Defibrillator - "", + // Defibrillator + "", - // Explosive Upgrade Pack - "", + // Explosive Upgrade Pack + "", - // Incendiary Upgrade Pack - "", + // Incendiary Upgrade Pack + "", - // Pain pills - "", + // Pain pills + "", - // Adrenaline - "" + // Adrenaline + "" }; static const char Weapon_Spawns[NUM_OF_WEAPONS][] = { - //==================================================== - // Weapons - //==================================================== + //==================================================== + // Weapons + //==================================================== - // NULL - "", + // NULL + "", - // SMG - "", + // SMG + "", - // Shotgun - "", + // Shotgun + "", - // Autoshotgun - "autoshotgun", + // Autoshotgun + "autoshotgun", - // Rifle - "rifle", + // Rifle + "rifle", - // Hunting rifle - "", + // Hunting rifle + "", - // SMG silenced - "", + // SMG silenced + "", - // Chrome shotgun - "", + // Chrome shotgun + "", - // Desert rifle - "rifle_desert", + // Desert rifle + "rifle_desert", - // Military rifle - "sniper_military", + // Military rifle + "sniper_military", - // Spas shotgun - "shotgun_spas", + // Spas shotgun + "shotgun_spas", - // Grenade launcher - "grenade_launcher", + // Grenade launcher + "grenade_launcher", - // AK47 - "rifle_ak47", + // AK47 + "rifle_ak47", - // M60 - "rifle_m60", + // M60 + "rifle_m60", - // MP5 - "", + // MP5 + "", - // SG552 - "", + // SG552 + "", - // AWP - "", + // AWP + "", - // Scout - "", + // Scout + "", - //==================================================== - // Melee Weapons - //==================================================== + //==================================================== + // Melee Weapons + //==================================================== - // Chainsaw - "chainsaw", + // Chainsaw + "chainsaw", - //==================================================== - // Extra Items - //==================================================== + //==================================================== + // Extra Items + //==================================================== - // Pipe Bomb - "pipe_bomb", + // Pipe Bomb + "pipe_bomb", - // Molotov - "molotov", + // Molotov + "molotov", - // Vomitjar - "vomitjar", + // Vomitjar + "vomitjar", - // First Aid Kit - "first_aid_kit", + // First Aid Kit + "first_aid_kit", - // Defibrillator - "defibrillator", + // Defibrillator + "defibrillator", - // Explosive Upgrade Pack - "upgradepack_explosive", + // Explosive Upgrade Pack + "upgradepack_explosive", - // Incendiary Upgrade Pack - "upgradepack_incendiary", + // Incendiary Upgrade Pack + "upgradepack_incendiary", - // Pain pills - "pain_pills", + // Pain pills + "pain_pills", - // Adrenaline - "adrenaline" + // Adrenaline + "adrenaline" }; //==================================================== // Kit Protection //==================================================== static int - Weapon_iKitEntity[WEAPON_NUMBER_OF_START_KITS] = {0, ...}, - Weapon_iKitCount = 0; + Weapon_iKitEntity[WEAPON_NUMBER_OF_START_KITS] = {0, ...}, + Weapon_iKitCount = 0; //==================================================== // Map Info //==================================================== static float - Weapon_fMapOrigin_Start[3], - Weapon_fMapOrigin_End[3], - Weapon_fMapDist_Start, - Weapon_fMapDist_StartExtra, - Weapon_fMapDist_End; + Weapon_fMapOrigin_Start[3], + Weapon_fMapOrigin_End[3], + Weapon_fMapDist_Start, + Weapon_fMapDist_StartExtra, + Weapon_fMapDist_End; static bool - Weapon_bUpdateMapInfo = true; + Weapon_bUpdateMapInfo = true; //==================================================== static bool - Weapon_bConvar[NUM_OF_WEAPONS] = {false, ...}, - Weapon_bReplaceTier2 = true, - Weapon_bReplaceTier2_Finale = true, - Weapon_bReplaceTier2_All = true, - Weapon_bLimitTier2 = true, - Weapon_bLimitTier2_Safehouse = true, - Weapon_bReplaceStartKits = true, - Weapon_bReplaceFinaleKits = true, - Weapon_bRemoveLaserSight = true, - Weapon_bRemoveExtraItems = true; + Weapon_bConvar[NUM_OF_WEAPONS] = {false, ...}, + Weapon_bReplaceTier2 = true, + Weapon_bReplaceTier2_Finale = true, + Weapon_bReplaceTier2_All = true, + Weapon_bLimitTier2 = true, + Weapon_bLimitTier2_Safehouse = true, + Weapon_bReplaceStartKits = true, + Weapon_bReplaceFinaleKits = true, + Weapon_bRemoveLaserSight = true, + Weapon_bRemoveExtraItems = true; static ConVar - Weapon_hConvar[NUM_OF_WEAPONS] = {null, ...}, - Weapon_hReplaceTier2 = null, - Weapon_hReplaceTier2_Finale = null, - Weapon_hReplaceTier2_All = null, - Weapon_hLimitTier2 = null, - Weapon_hLimitTier2_Safehouse = null, - Weapon_hReplaceStartKits = null, - Weapon_hReplaceFinaleKits = null, - Weapon_hRemoveLaserSight = null, - Weapon_hRemoveExtraItems = null; + Weapon_hConvar[NUM_OF_WEAPONS] = {null, ...}, + Weapon_hReplaceTier2 = null, + Weapon_hReplaceTier2_Finale = null, + Weapon_hReplaceTier2_All = null, + Weapon_hLimitTier2 = null, + Weapon_hLimitTier2_Safehouse = null, + Weapon_hReplaceStartKits = null, + Weapon_hReplaceFinaleKits = null, + Weapon_hRemoveLaserSight = null, + Weapon_hRemoveExtraItems = null; //==================================================== // Module setup //==================================================== void WI_OnModuleStart() { - WI_Convar_Setup(); + WI_Convar_Setup(); - HookEvent("round_start", WI_RoundStart_Event, EventHookMode_PostNoCopy); - HookEvent("round_end", WI_RoundEnd_Event, EventHookMode_PostNoCopy); - HookEvent("spawner_give_item", WI_SpawnerGiveItem_Event); + HookEvent("round_start", WI_RoundStart_Event, EventHookMode_PostNoCopy); + HookEvent("round_end", WI_RoundEnd_Event, EventHookMode_PostNoCopy); + HookEvent("spawner_give_item", WI_SpawnerGiveItem_Event); } void WI_OnMapEnd() { - Weapon_bUpdateMapInfo = true; + Weapon_bUpdateMapInfo = true; } //==================================================== @@ -574,77 +574,77 @@ void WI_OnMapEnd() //==================================================== static void WI_Convar_Setup() { - Weapon_hConvar[WEAPON_SMG_MP5_INDEX] = CreateConVarEx("replace_cssweapons", "1", "Replace CSS weapons with normal L4D2 weapons", _, true, 0.0, true, 1.0); - - Weapon_hConvar[WEAPON_RIFLE_SG552_INDEX] = Weapon_hConvar[WEAPON_SMG_MP5_INDEX]; - Weapon_hConvar[WEAPON_SNIPER_AWP_INDEX] = Weapon_hConvar[WEAPON_SMG_MP5_INDEX]; - Weapon_hConvar[WEAPON_SNIPER_SCOUT_INDEX] = Weapon_hConvar[WEAPON_SMG_MP5_INDEX]; - - Weapon_hConvar[WEAPON_GRENADE_LAUNCHER_INDEX] = CreateConVarEx("remove_grenade", "1", "Remove all grenade launchers", _, true, 0.0, true, 1.0); - Weapon_hConvar[WEAPON_CHAINSAW_INDEX] = CreateConVarEx("remove_chainsaw", "1", "Remove all chainsaws", _, true, 0.0, true, 1.0); - Weapon_hConvar[WEAPON_RIFLE_M60_INDEX] = CreateConVarEx("remove_m60", "1", "Remove all M60 rifles", _, true, 0.0, true, 1.0); - - Weapon_hConvar[WEAPON_FIRST_AID_KIT_INDEX] = CreateConVarEx("remove_statickits", "1", "Remove all static medkits (medkits such as the gun shop, these are compiled into the map)", _, true, 0.0, true, 1.0); - Weapon_hConvar[WEAPON_DEFIBRILLATOR_INDEX] = CreateConVarEx("remove_defib", "1", "Remove all defibrillators", _, true, 0.0, true, 1.0); - Weapon_hConvar[WEAPON_UPG_EXPLOSIVE_INDEX] = CreateConVarEx("remove_upg_explosive", "1", "Remove all explosive upgrade packs", _, true, 0.0, true, 1.0); - Weapon_hConvar[WEAPON_UPG_INCENDIARY_INDEX] = CreateConVarEx("remove_upg_incendiary", "1", "Remove all incendiary upgrade packs", _, true, 0.0, true, 1.0); - - for (int index = FIRST_WEAPON; index < NUM_OF_WEAPONS; index++) { - if (Weapon_hConvar[index] == null) { - continue; - } - - Weapon_bConvar[index] = Weapon_hConvar[index].BoolValue; - Weapon_hConvar[index].AddChangeHook(WI_ConvarChange); - } - - Weapon_hReplaceTier2 = CreateConVarEx("replace_tier2", "1", "Replace tier 2 weapons in start and end safe room with their tier 1 equivalent", _, true, 0.0, true, 1.0); - Weapon_hReplaceTier2_Finale = CreateConVarEx("replace_tier2_finale", "1", "Replace tier 2 weapons in start safe room with their tier 1 equivalent, on finale", _, true, 0.0, true, 1.0); - Weapon_hReplaceTier2_All = CreateConVarEx("replace_tier2_all", "1", "Replace ALL tier 2 weapons with their tier 1 equivalent EVERYWHERE", _, true, 0.0, true, 1.0); - Weapon_hLimitTier2 = CreateConVarEx("limit_tier2", "1", "Limit tier 2 weapons outside safe rooms. Replaces a tier 2 stack with tier 1 upon first weapon pickup", _, true, 0.0, true, 1.0); - Weapon_hLimitTier2_Safehouse = CreateConVarEx("limit_tier2_saferoom", "1", "Limit tier 2 weapons inside safe rooms. Replaces a tier 2 stack with tier 1 upon first weapon pickup", _, true, 0.0, true, 1.0); - Weapon_hReplaceStartKits = CreateConVarEx("replace_startkits", "1", "Replaces start medkits with pills", _, true, 0.0, true, 1.0); - Weapon_hReplaceFinaleKits = CreateConVarEx("replace_finalekits", "1", "Replaces finale medkits with pills", _, true, 0.0, true, 1.0); - Weapon_hRemoveLaserSight = CreateConVarEx("remove_lasersight", "1", "Remove all laser sight upgrades", _, true, 0.0, true, 1.0); - Weapon_hRemoveExtraItems = CreateConVarEx("remove_saferoomitems", "1", "Remove all extra items inside saferooms (items for slot 3, 4 and 5, minus medkits)", _, true, 0.0, true, 1.0); - - ConVarsInType(); - - Weapon_hReplaceTier2.AddChangeHook(WI_ConvarChange); - Weapon_hReplaceTier2_Finale.AddChangeHook(WI_ConvarChange); - Weapon_hReplaceTier2_All.AddChangeHook(WI_ConvarChange); - Weapon_hLimitTier2.AddChangeHook(WI_ConvarChange); - Weapon_hLimitTier2_Safehouse.AddChangeHook(WI_ConvarChange); - Weapon_hReplaceStartKits.AddChangeHook(WI_ConvarChange); - Weapon_hReplaceFinaleKits.AddChangeHook(WI_ConvarChange); - Weapon_hRemoveLaserSight.AddChangeHook(WI_ConvarChange); - Weapon_hRemoveExtraItems.AddChangeHook(WI_ConvarChange); + Weapon_hConvar[WEAPON_SMG_MP5_INDEX] = CreateConVarEx("replace_cssweapons", "1", "Replace CSS weapons with normal L4D2 weapons", _, true, 0.0, true, 1.0); + + Weapon_hConvar[WEAPON_RIFLE_SG552_INDEX] = Weapon_hConvar[WEAPON_SMG_MP5_INDEX]; + Weapon_hConvar[WEAPON_SNIPER_AWP_INDEX] = Weapon_hConvar[WEAPON_SMG_MP5_INDEX]; + Weapon_hConvar[WEAPON_SNIPER_SCOUT_INDEX] = Weapon_hConvar[WEAPON_SMG_MP5_INDEX]; + + Weapon_hConvar[WEAPON_GRENADE_LAUNCHER_INDEX] = CreateConVarEx("remove_grenade", "1", "Remove all grenade launchers", _, true, 0.0, true, 1.0); + Weapon_hConvar[WEAPON_CHAINSAW_INDEX] = CreateConVarEx("remove_chainsaw", "1", "Remove all chainsaws", _, true, 0.0, true, 1.0); + Weapon_hConvar[WEAPON_RIFLE_M60_INDEX] = CreateConVarEx("remove_m60", "1", "Remove all M60 rifles", _, true, 0.0, true, 1.0); + + Weapon_hConvar[WEAPON_FIRST_AID_KIT_INDEX] = CreateConVarEx("remove_statickits", "1", "Remove all static medkits (medkits such as the gun shop, these are compiled into the map)", _, true, 0.0, true, 1.0); + Weapon_hConvar[WEAPON_DEFIBRILLATOR_INDEX] = CreateConVarEx("remove_defib", "1", "Remove all defibrillators", _, true, 0.0, true, 1.0); + Weapon_hConvar[WEAPON_UPG_EXPLOSIVE_INDEX] = CreateConVarEx("remove_upg_explosive", "1", "Remove all explosive upgrade packs", _, true, 0.0, true, 1.0); + Weapon_hConvar[WEAPON_UPG_INCENDIARY_INDEX] = CreateConVarEx("remove_upg_incendiary", "1", "Remove all incendiary upgrade packs", _, true, 0.0, true, 1.0); + + for (int index = FIRST_WEAPON; index < NUM_OF_WEAPONS; index++) { + if (Weapon_hConvar[index] == null) { + continue; + } + + Weapon_bConvar[index] = Weapon_hConvar[index].BoolValue; + Weapon_hConvar[index].AddChangeHook(WI_ConvarChange); + } + + Weapon_hReplaceTier2 = CreateConVarEx("replace_tier2", "1", "Replace tier 2 weapons in start and end safe room with their tier 1 equivalent", _, true, 0.0, true, 1.0); + Weapon_hReplaceTier2_Finale = CreateConVarEx("replace_tier2_finale", "1", "Replace tier 2 weapons in start safe room with their tier 1 equivalent, on finale", _, true, 0.0, true, 1.0); + Weapon_hReplaceTier2_All = CreateConVarEx("replace_tier2_all", "1", "Replace ALL tier 2 weapons with their tier 1 equivalent EVERYWHERE", _, true, 0.0, true, 1.0); + Weapon_hLimitTier2 = CreateConVarEx("limit_tier2", "1", "Limit tier 2 weapons outside safe rooms. Replaces a tier 2 stack with tier 1 upon first weapon pickup", _, true, 0.0, true, 1.0); + Weapon_hLimitTier2_Safehouse = CreateConVarEx("limit_tier2_saferoom", "1", "Limit tier 2 weapons inside safe rooms. Replaces a tier 2 stack with tier 1 upon first weapon pickup", _, true, 0.0, true, 1.0); + Weapon_hReplaceStartKits = CreateConVarEx("replace_startkits", "1", "Replaces start medkits with pills", _, true, 0.0, true, 1.0); + Weapon_hReplaceFinaleKits = CreateConVarEx("replace_finalekits", "1", "Replaces finale medkits with pills", _, true, 0.0, true, 1.0); + Weapon_hRemoveLaserSight = CreateConVarEx("remove_lasersight", "1", "Remove all laser sight upgrades", _, true, 0.0, true, 1.0); + Weapon_hRemoveExtraItems = CreateConVarEx("remove_saferoomitems", "1", "Remove all extra items inside saferooms (items for slot 3, 4 and 5, minus medkits)", _, true, 0.0, true, 1.0); + + ConVarsInType(); + + Weapon_hReplaceTier2.AddChangeHook(WI_ConvarChange); + Weapon_hReplaceTier2_Finale.AddChangeHook(WI_ConvarChange); + Weapon_hReplaceTier2_All.AddChangeHook(WI_ConvarChange); + Weapon_hLimitTier2.AddChangeHook(WI_ConvarChange); + Weapon_hLimitTier2_Safehouse.AddChangeHook(WI_ConvarChange); + Weapon_hReplaceStartKits.AddChangeHook(WI_ConvarChange); + Weapon_hReplaceFinaleKits.AddChangeHook(WI_ConvarChange); + Weapon_hRemoveLaserSight.AddChangeHook(WI_ConvarChange); + Weapon_hRemoveExtraItems.AddChangeHook(WI_ConvarChange); } static void ConVarsInType() { - Weapon_bReplaceTier2 = Weapon_hReplaceTier2.BoolValue; - Weapon_bReplaceTier2_Finale = Weapon_hReplaceTier2_Finale.BoolValue; - Weapon_bReplaceTier2_All = Weapon_hReplaceTier2_All.BoolValue; - Weapon_bLimitTier2 = Weapon_hLimitTier2.BoolValue; - Weapon_bLimitTier2_Safehouse = Weapon_hLimitTier2_Safehouse.BoolValue; - Weapon_bReplaceStartKits = Weapon_hReplaceStartKits.BoolValue; - Weapon_bReplaceFinaleKits = Weapon_hReplaceFinaleKits.BoolValue; - Weapon_bRemoveLaserSight = Weapon_hRemoveLaserSight.BoolValue; - Weapon_bRemoveExtraItems = Weapon_hRemoveExtraItems.BoolValue; + Weapon_bReplaceTier2 = Weapon_hReplaceTier2.BoolValue; + Weapon_bReplaceTier2_Finale = Weapon_hReplaceTier2_Finale.BoolValue; + Weapon_bReplaceTier2_All = Weapon_hReplaceTier2_All.BoolValue; + Weapon_bLimitTier2 = Weapon_hLimitTier2.BoolValue; + Weapon_bLimitTier2_Safehouse = Weapon_hLimitTier2_Safehouse.BoolValue; + Weapon_bReplaceStartKits = Weapon_hReplaceStartKits.BoolValue; + Weapon_bReplaceFinaleKits = Weapon_hReplaceFinaleKits.BoolValue; + Weapon_bRemoveLaserSight = Weapon_hRemoveLaserSight.BoolValue; + Weapon_bRemoveExtraItems = Weapon_hRemoveExtraItems.BoolValue; } public void WI_ConvarChange(ConVar hConVar, const char[] sOldValue, const char[] sNewValue) { - for (int index = FIRST_WEAPON; index < NUM_OF_WEAPONS; index++) { - if (Weapon_hConvar[index] == null) { - continue; - } + for (int index = FIRST_WEAPON; index < NUM_OF_WEAPONS; index++) { + if (Weapon_hConvar[index] == null) { + continue; + } - Weapon_bConvar[index] = Weapon_hConvar[index].BoolValue; - } + Weapon_bConvar[index] = Weapon_hConvar[index].BoolValue; + } - ConVarsInType(); + ConVarsInType(); } //================================================ @@ -654,99 +654,99 @@ public void WI_ConvarChange(ConVar hConVar, const char[] sOldValue, const char[] // class static int WI_GetWeaponIndex(int iEntity, const char[] sEntityClassName) { - //------------------------------------------------ - // Check for weapon in class name - //------------------------------------------------ - // If the class name doesn't contain weapon at all - // we don't need to loop thourgh with this entity - // Return false + //------------------------------------------------ + // Check for weapon in class name + //------------------------------------------------ + // If the class name doesn't contain weapon at all + // we don't need to loop thourgh with this entity + // Return false - if (StrContains(sEntityClassName, "weapon") == -1) { - return WEAPON_NULL_INDEX; - } + if (StrContains(sEntityClassName, "weapon") == -1) { + return WEAPON_NULL_INDEX; + } #if (DEBUG_WI) - LogMessage("[%s] GetWeaponIndex( iEntity %i sEntityClassName \"%s\" )", WI_MODULE_NAME, iEntity, sEntityClassName); - LogMessage("[%s] {", WI_MODULE_NAME); + LogMessage("[%s] GetWeaponIndex( iEntity %i sEntityClassName \"%s\" )", WI_MODULE_NAME, iEntity, sEntityClassName); + LogMessage("[%s] {", WI_MODULE_NAME); #endif - //------------------------------------------------ - // Check class name - //------------------------------------------------ - // If the class name is weapon_spawn we got a - // dynamic spawn and as such read the weapon id - // for detimernation of the weapon index - - int WeaponIndex; - bool bFoundIndex = false; - - if (strcmp(sEntityClassName, "weapon_spawn") == 0) { - int WepID = GetEntProp(iEntity, Prop_Send, "m_weaponID"); - - #if (DEBUG_WI) - LogMessage("[%s] Dynamic weapon spawn, weaponID %i", WI_MODULE_NAME, WepID); - #endif - - for (WeaponIndex = FIRST_WEAPON; WeaponIndex < NUM_OF_WEAPONS; WeaponIndex++) { - if (Weapon_Attributes[WeaponIndex][WeaponID] != WepID) { - continue; - } - - #if (DEBUG_WI) - LogMessage("[%s] Weapon WeaponIndex %i", WI_MODULE_NAME, WeaponIndex); - #endif - - bFoundIndex = true; - break; - } - } - //------------------------------------------------ - // Check static spawns - //------------------------------------------------ - // Otherwise loop through the weapon index for - // static classes - // If we got a match we know the index - else { - char sBuffer[MAX_ENTITY_NAME_LENGTH]; - for (WeaponIndex = FIRST_WEAPON; WeaponIndex < NUM_OF_WEAPONS; WeaponIndex++) { - if (strlen(Weapon_Spawns[WeaponIndex]) < 1) { - continue; - } - - Format(sBuffer, sizeof(sBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WeaponIndex], SPAWN_SURFIX); - - if (strcmp(sEntityClassName, sBuffer) != 0) { - continue; - } - - #if (DEBUG_WI) - LogMessage("[%s] Static spawn, weapon WeaponIndex %i", WI_MODULE_NAME, WeaponIndex); - #endif - - bFoundIndex = true; - break; - } - } - - //------------------------------------------------ - // Check index - //------------------------------------------------ - // If we didn't find the index, return false - - if (!bFoundIndex) { - #if (DEBUG_WI) - LogMessage("[%s] Not found in weapon index", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return WEAPON_NULL_INDEX; - } + //------------------------------------------------ + // Check class name + //------------------------------------------------ + // If the class name is weapon_spawn we got a + // dynamic spawn and as such read the weapon id + // for detimernation of the weapon index + + int WeaponIndex; + bool bFoundIndex = false; + + if (strcmp(sEntityClassName, "weapon_spawn") == 0) { + int WepID = GetEntProp(iEntity, Prop_Send, "m_weaponID"); + + #if (DEBUG_WI) + LogMessage("[%s] Dynamic weapon spawn, weaponID %i", WI_MODULE_NAME, WepID); + #endif + + for (WeaponIndex = FIRST_WEAPON; WeaponIndex < NUM_OF_WEAPONS; WeaponIndex++) { + if (Weapon_Attributes[WeaponIndex][WeaponID] != WepID) { + continue; + } + + #if (DEBUG_WI) + LogMessage("[%s] Weapon WeaponIndex %i", WI_MODULE_NAME, WeaponIndex); + #endif + + bFoundIndex = true; + break; + } + } + //------------------------------------------------ + // Check static spawns + //------------------------------------------------ + // Otherwise loop through the weapon index for + // static classes + // If we got a match we know the index + else { + char sBuffer[MAX_ENTITY_NAME_LENGTH]; + for (WeaponIndex = FIRST_WEAPON; WeaponIndex < NUM_OF_WEAPONS; WeaponIndex++) { + if (strlen(Weapon_Spawns[WeaponIndex]) < 1) { + continue; + } + + Format(sBuffer, sizeof(sBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WeaponIndex], SPAWN_SURFIX); + + if (strcmp(sEntityClassName, sBuffer) != 0) { + continue; + } + + #if (DEBUG_WI) + LogMessage("[%s] Static spawn, weapon WeaponIndex %i", WI_MODULE_NAME, WeaponIndex); + #endif + + bFoundIndex = true; + break; + } + } + + //------------------------------------------------ + // Check index + //------------------------------------------------ + // If we didn't find the index, return false + + if (!bFoundIndex) { + #if (DEBUG_WI) + LogMessage("[%s] Not found in weapon index", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return WEAPON_NULL_INDEX; + } #if (DEBUG_WI) - LogMessage("[%s] }", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); #endif - return WeaponIndex; + return WeaponIndex; } //================================================ @@ -757,26 +757,26 @@ static int WI_GetWeaponIndex(int iEntity, const char[] sEntityClassName) static bool WI_IsStatic(int iEntity, int iWeaponIndex) { - if (strlen(Weapon_Spawns[iWeaponIndex]) < 1) { - return false; - } + if (strlen(Weapon_Spawns[iWeaponIndex]) < 1) { + return false; + } - char sEntityClassName[MAX_ENTITY_NAME_LENGTH], sBuffer[MAX_ENTITY_NAME_LENGTH]; + char sEntityClassName[MAX_ENTITY_NAME_LENGTH], sBuffer[MAX_ENTITY_NAME_LENGTH]; - GetEdictClassname(iEntity, sEntityClassName, sizeof(sEntityClassName)); - Format(sBuffer, sizeof(sBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[iWeaponIndex], SPAWN_SURFIX); + GetEdictClassname(iEntity, sEntityClassName, sizeof(sEntityClassName)); + Format(sBuffer, sizeof(sBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[iWeaponIndex], SPAWN_SURFIX); - if (strcmp(sEntityClassName, sBuffer) != 0) { - return false; - } + if (strcmp(sEntityClassName, sBuffer) != 0) { + return false; + } - // This is to prevent crashing - // Some static spawns doesn't have a model as we just wish to remove them - if (strlen(Weapon_Models[iWeaponIndex]) < 1) { - return false; - } + // This is to prevent crashing + // Some static spawns doesn't have a model as we just wish to remove them + if (strlen(Weapon_Models[iWeaponIndex]) < 1) { + return false; + } - return true; + return true; } //================================================ @@ -787,187 +787,187 @@ static bool WI_IsStatic(int iEntity, int iWeaponIndex) static void WI_ReplaceWeapon(int iEntity, int iWeaponIndex, bool bSpawnerEvent = false) { - #if (DEBUG_WI) - LogMessage("[%s] ReplaceWeapon( iEntity %i, iWeaponIndex %i, bSpawnerEvent %b )", WI_MODULE_NAME, iEntity, iWeaponIndex, bSpawnerEvent); - LogMessage("[%s] {", WI_MODULE_NAME); - #endif - - //------------------------------------------------ - // Removal of weapons - //------------------------------------------------ - // Checks if the replacement index is equal to -1 - // (WEAPON_REMOVE_INDEX) - // If so, check the cvar boolean and kill the - // weapon - - if (!bSpawnerEvent - && Weapon_Attributes[iWeaponIndex][ReplacementIndex] == WEAPON_REMOVE_INDEX - && Weapon_bConvar[iWeaponIndex] - ) { - KillEntity(iEntity); - - #if (DEBUG_WI) - LogMessage("[%s] Killing weapon as requested...", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - - //------------------------------------------------ - // Replacement of static weapons - //------------------------------------------------ - // Replaces all weapon_*weaponname*_spawn with - // weapon_spawn and the old weapon ID - - char sModelBuffer[PLATFORM_MAX_PATH]; - float fOrigin[3], fRotation[3]; - - if (!bSpawnerEvent - && WI_IsStatic(iEntity, iWeaponIndex) - && (Weapon_Attributes[iWeaponIndex][WeaponID] != WEAPON_NULL_INDEX) - ) { - GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fOrigin); - GetEntPropVector(iEntity, Prop_Send, "m_angRotation", fRotation); - KillEntity(iEntity); - - iEntity = CreateEntityByName("weapon_spawn"); - SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); - - Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); - SetEntityModel(iEntity, sModelBuffer); - - TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); - DispatchKeyValue(iEntity, "count", "5"); - DispatchSpawn(iEntity); - SetEntityMoveType(iEntity, MOVETYPE_NONE); - - #if (DEBUG_WI) - LogMessage("[%s] Replacing static spawn with weapon_spawn, new iEntity %i, weaponID %i, model \"%s\"", \ - WI_MODULE_NAME, iEntity, Weapon_Attributes[iWeaponIndex][WeaponID], sModelBuffer); - #endif - } - - //------------------------------------------------ - // Replace Weapons - //------------------------------------------------ - // Replace weapons that needs to be done so - // This is to replace CSS weapons, but can be - // adjusted to fit with any weapon - - if ((!bSpawnerEvent - && Weapon_Attributes[iWeaponIndex][ReplacementIndex] != WEAPON_NULL_INDEX - || Weapon_Attributes[iWeaponIndex][ReplacementIndex] != WEAPON_REMOVE_INDEX) - && Weapon_bConvar[iWeaponIndex] - ) { - iWeaponIndex = Weapon_Attributes[iWeaponIndex][ReplacementIndex]; - SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); - Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); - SetEntityModel(iEntity, sModelBuffer); - - #if (DEBUG_WI) - LogMessage("[%s] Following replacement index, new weaponID %i, new model \"%s\"", WI_MODULE_NAME, iWeaponIndex, sModelBuffer); - #endif - } - - //------------------------------------------------ - // Check for tier 1 equivalent - //------------------------------------------------ - // Check the current weapon index for a tier 1 - // equivalent - - if (Weapon_Attributes[iWeaponIndex][Tier1EquivalentIndex] == WEAPON_NULL_INDEX) { - #if (DEBUG_WI) - LogMessage("[%s] No tier 1 equivalent, no need to proceed", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - - //------------------------------------------------ - // Check location - //------------------------------------------------ - // Check the location of the weapon, to see if its - // within a saferoom - - bool bIsInSaferoom = false; - GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fOrigin); - - // Within start safe room - if (!Weapon_bReplaceTier2_All && IsVersus()) { - if (GetVectorDistance(Weapon_fMapOrigin_Start, fOrigin) > Weapon_fMapDist_StartExtra - && GetVectorDistance(Weapon_fMapOrigin_End, fOrigin) > Weapon_fMapDist_End - ) { - #if (DEBUG_WI) - LogMessage("[%s] Weapon is outside of a saferoom", WI_MODULE_NAME); - #endif - - if (!bSpawnerEvent) { - #if (DEBUG_WI) - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - return; - } - } else { - #if (DEBUG_WI) - LogMessage("[%s] Weapon is inside a saferoom", WI_MODULE_NAME); - #endif - bIsInSaferoom = true; - } - } - - //------------------------------------------------ - // Check tier 2 replacement booleans - //------------------------------------------------ - // Check and see if the plugin is set to replace - // tier 2 weapons - // One for non-finale maps and one for finales - - if (!Weapon_bReplaceTier2_All) { - if (!bSpawnerEvent) { - if ((!Weapon_bReplaceTier2 && !L4D_IsMissionFinalMap()) || (!Weapon_bReplaceTier2_Finale && L4D_IsMissionFinalMap())) { - #if (DEBUG_WI) - LogMessage("[%s] We do not want to replace weapons, IsMapFinale %b", WI_MODULE_NAME, L4D_IsMissionFinalMap()); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - } else { - if ((!Weapon_bLimitTier2 && !bIsInSaferoom) || (!Weapon_bLimitTier2_Safehouse && bIsInSaferoom)) { - #if (DEBUG_WI) - LogMessage("[%s] We do not want to replace weapons, bLimitTier2 %b, bLimitTier2_Saferoom %b, bIsInSaferoom %b", \ - WI_MODULE_NAME, Weapon_bLimitTier2, Weapon_bLimitTier2_Safehouse, bIsInSaferoom); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - } - } + #if (DEBUG_WI) + LogMessage("[%s] ReplaceWeapon( iEntity %i, iWeaponIndex %i, bSpawnerEvent %b )", WI_MODULE_NAME, iEntity, iWeaponIndex, bSpawnerEvent); + LogMessage("[%s] {", WI_MODULE_NAME); + #endif + + //------------------------------------------------ + // Removal of weapons + //------------------------------------------------ + // Checks if the replacement index is equal to -1 + // (WEAPON_REMOVE_INDEX) + // If so, check the cvar boolean and kill the + // weapon + + if (!bSpawnerEvent + && Weapon_Attributes[iWeaponIndex][ReplacementIndex] == WEAPON_REMOVE_INDEX + && Weapon_bConvar[iWeaponIndex] + ) { + KillEntity(iEntity); + + #if (DEBUG_WI) + LogMessage("[%s] Killing weapon as requested...", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + + //------------------------------------------------ + // Replacement of static weapons + //------------------------------------------------ + // Replaces all weapon_*weaponname*_spawn with + // weapon_spawn and the old weapon ID + + char sModelBuffer[PLATFORM_MAX_PATH]; + float fOrigin[3], fRotation[3]; + + if (!bSpawnerEvent + && WI_IsStatic(iEntity, iWeaponIndex) + && (Weapon_Attributes[iWeaponIndex][WeaponID] != WEAPON_NULL_INDEX) + ) { + GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fOrigin); + GetEntPropVector(iEntity, Prop_Send, "m_angRotation", fRotation); + KillEntity(iEntity); + + iEntity = CreateEntityByName("weapon_spawn"); + SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); + + Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); + SetEntityModel(iEntity, sModelBuffer); + + TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); + DispatchKeyValue(iEntity, "count", "5"); + DispatchSpawn(iEntity); + SetEntityMoveType(iEntity, MOVETYPE_NONE); + + #if (DEBUG_WI) + LogMessage("[%s] Replacing static spawn with weapon_spawn, new iEntity %i, weaponID %i, model \"%s\"", \ + WI_MODULE_NAME, iEntity, Weapon_Attributes[iWeaponIndex][WeaponID], sModelBuffer); + #endif + } + + //------------------------------------------------ + // Replace Weapons + //------------------------------------------------ + // Replace weapons that needs to be done so + // This is to replace CSS weapons, but can be + // adjusted to fit with any weapon + + if ((!bSpawnerEvent + && Weapon_Attributes[iWeaponIndex][ReplacementIndex] != WEAPON_NULL_INDEX + || Weapon_Attributes[iWeaponIndex][ReplacementIndex] != WEAPON_REMOVE_INDEX) + && Weapon_bConvar[iWeaponIndex] + ) { + iWeaponIndex = Weapon_Attributes[iWeaponIndex][ReplacementIndex]; + SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); + Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); + SetEntityModel(iEntity, sModelBuffer); + + #if (DEBUG_WI) + LogMessage("[%s] Following replacement index, new weaponID %i, new model \"%s\"", WI_MODULE_NAME, iWeaponIndex, sModelBuffer); + #endif + } + + //------------------------------------------------ + // Check for tier 1 equivalent + //------------------------------------------------ + // Check the current weapon index for a tier 1 + // equivalent + + if (Weapon_Attributes[iWeaponIndex][Tier1EquivalentIndex] == WEAPON_NULL_INDEX) { + #if (DEBUG_WI) + LogMessage("[%s] No tier 1 equivalent, no need to proceed", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + + //------------------------------------------------ + // Check location + //------------------------------------------------ + // Check the location of the weapon, to see if its + // within a saferoom + + bool bIsInSaferoom = false; + GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fOrigin); + + // Within start safe room + if (!Weapon_bReplaceTier2_All && IsVersus()) { + if (GetVectorDistance(Weapon_fMapOrigin_Start, fOrigin) > Weapon_fMapDist_StartExtra + && GetVectorDistance(Weapon_fMapOrigin_End, fOrigin) > Weapon_fMapDist_End + ) { + #if (DEBUG_WI) + LogMessage("[%s] Weapon is outside of a saferoom", WI_MODULE_NAME); + #endif + + if (!bSpawnerEvent) { + #if (DEBUG_WI) + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + return; + } + } else { + #if (DEBUG_WI) + LogMessage("[%s] Weapon is inside a saferoom", WI_MODULE_NAME); + #endif + bIsInSaferoom = true; + } + } + + //------------------------------------------------ + // Check tier 2 replacement booleans + //------------------------------------------------ + // Check and see if the plugin is set to replace + // tier 2 weapons + // One for non-finale maps and one for finales + + if (!Weapon_bReplaceTier2_All) { + if (!bSpawnerEvent) { + if ((!Weapon_bReplaceTier2 && !L4D_IsMissionFinalMap()) || (!Weapon_bReplaceTier2_Finale && L4D_IsMissionFinalMap())) { + #if (DEBUG_WI) + LogMessage("[%s] We do not want to replace weapons, IsMapFinale %b", WI_MODULE_NAME, L4D_IsMissionFinalMap()); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + } else { + if ((!Weapon_bLimitTier2 && !bIsInSaferoom) || (!Weapon_bLimitTier2_Safehouse && bIsInSaferoom)) { + #if (DEBUG_WI) + LogMessage("[%s] We do not want to replace weapons, bLimitTier2 %b, bLimitTier2_Saferoom %b, bIsInSaferoom %b", \ + WI_MODULE_NAME, Weapon_bLimitTier2, Weapon_bLimitTier2_Safehouse, bIsInSaferoom); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + } + } #if (DEBUG_WI) - else { - LogMessage("[%s] bReplaceTier2_All %b", WI_MODULE_NAME, Weapon_bReplaceTier2_All); - } + else { + LogMessage("[%s] bReplaceTier2_All %b", WI_MODULE_NAME, Weapon_bReplaceTier2_All); + } #endif - //------------------------------------------------ - // Replace tier 2 weapon - //------------------------------------------------ - // And lastly after all these steps, this is where - // the magic happens - // Replace the weapon with its tier 1 equivalent - // and update the model + //------------------------------------------------ + // Replace tier 2 weapon + //------------------------------------------------ + // And lastly after all these steps, this is where + // the magic happens + // Replace the weapon with its tier 1 equivalent + // and update the model - iWeaponIndex = Weapon_Attributes[iWeaponIndex][Tier1EquivalentIndex]; - SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); - Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); - SetEntityModel(iEntity, sModelBuffer); + iWeaponIndex = Weapon_Attributes[iWeaponIndex][Tier1EquivalentIndex]; + SetEntProp(iEntity, Prop_Send, "m_weaponID", Weapon_Attributes[iWeaponIndex][WeaponID]); + Format(sModelBuffer, sizeof(sModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[iWeaponIndex], MODEL_SURFIX); + SetEntityModel(iEntity, sModelBuffer); #if (DEBUG_WI) - LogMessage("[%s] Replacing Tier 2, new WeaponID %i, model \"%s\"", WI_MODULE_NAME, Weapon_Attributes[iWeaponIndex][WeaponID], sModelBuffer); - LogMessage("[%s] }", WI_MODULE_NAME); + LogMessage("[%s] Replacing Tier 2, new WeaponID %i, model \"%s\"", WI_MODULE_NAME, Weapon_Attributes[iWeaponIndex][WeaponID], sModelBuffer); + LogMessage("[%s] }", WI_MODULE_NAME); #endif } @@ -980,177 +980,177 @@ static void WI_ReplaceWeapon(int iEntity, int iWeaponIndex, bool bSpawnerEvent = static void WI_ReplaceExtra(int iEntity, int iWeaponIndex) { #if (DEBUG_WI) - LogMessage("[%s] ReplaceExtra( iEntity %i, iWeaponIndex %i )", WI_MODULE_NAME, iEntity, iWeaponIndex); - LogMessage("[%s] {", WI_MODULE_NAME); + LogMessage("[%s] ReplaceExtra( iEntity %i, iWeaponIndex %i )", WI_MODULE_NAME, iEntity, iWeaponIndex); + LogMessage("[%s] {", WI_MODULE_NAME); #endif - //------------------------------------------------ - // Removal of extras - //------------------------------------------------ - // Checks if the replacement index is equal to -1 - // (WEAPON_REMOVE_INDEX) - // If so, check the cvar boolean and kill the - // weapon, minus medkits as these needs special - // care - - if (Weapon_Attributes[iWeaponIndex][ReplacementIndex] == WEAPON_REMOVE_INDEX - && Weapon_bConvar[iWeaponIndex] - && iWeaponIndex != WEAPON_FIRST_AID_KIT_INDEX - ) { - KillEntity(iEntity); - - #if (DEBUG_WI) - LogMessage("[%s] Killing weapon as requested...", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - - //------------------------------------------------ - // Check entity - //------------------------------------------------ - // Stop removing extra items that are protected - // (medkits converted to pain pills) - for (int Index = 0; Index < WEAPON_NUMBER_OF_START_KITS; Index++) { - if (Weapon_iKitEntity[Index] == iEntity) { - #if (DEBUG_WI) - LogMessage("[%s] Start kit found, save entity", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - } - - //------------------------------------------------ - // Check location - //------------------------------------------------ - // If the item is within the end safe room and its - // not finale - // OR - // If the items is within start safe room, and it - // is not a first aid kit - // Remove the item - float fOrigin[3]; - GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fOrigin); - - bool bIsInStartSaferoom = false, bIsInStartSaferoomExtra = false; - bool bIsInEndSaferoom = false, bIsInFinaleArea = false; - - float fStartDistance = GetVectorDistance(Weapon_fMapOrigin_Start, fOrigin); - - if (fStartDistance <= Weapon_fMapDist_Start) { - bIsInStartSaferoom = true; - bIsInStartSaferoomExtra = true; - } else if (fStartDistance <= Weapon_fMapDist_StartExtra) { - bIsInStartSaferoomExtra = true; - } else if (GetVectorDistance(Weapon_fMapOrigin_End, fOrigin) <= Weapon_fMapDist_End) { - if (L4D_IsMissionFinalMap()) { - bIsInFinaleArea = true; - } else { - bIsInEndSaferoom = true; - } - } - - if (Weapon_bRemoveExtraItems && - (bIsInEndSaferoom || (bIsInStartSaferoomExtra && iWeaponIndex != WEAPON_FIRST_AID_KIT_INDEX)) - ) { - KillEntity(iEntity); - - #if (DEBUG_WI) - LogMessage("[%s] Extra item is within a safe room, killing...", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - - //------------------------------------------------ - // Check for medkit - //------------------------------------------------ - // No need to go on if it is not a medkit - - if (iWeaponIndex != WEAPON_FIRST_AID_KIT_INDEX) { - #if (DEBUG_WI) - LogMessage("[%s] Not a medkit and not inside any saferoom, no need to go on", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - - //------------------------------------------------ - // Check location of medkit - //------------------------------------------------ - // If its outside the start safe room we assume - // it is a static medkit and it needs removal - - if (Weapon_bConvar[iWeaponIndex] && !bIsInStartSaferoom && !bIsInFinaleArea) { - KillEntity(iEntity); - - #if (DEBUG_WI) - LogMessage("[%s] Static medkit outside saferoom and finale, killing...", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - - if (Weapon_iKitCount >= WEAPON_NUMBER_OF_START_KITS && bIsInStartSaferoom) { - KillEntity(iEntity); - - #if (DEBUG_WI) - LogMessage("[%s] More than 4 saferoom medkits found, killing entity...", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - - return; - } - - float fRotation[3]; - char sSpawnBuffer[MAX_ENTITY_NAME_LENGTH]; - - if (bIsInStartSaferoom && Weapon_bReplaceStartKits) { - GetEntPropVector(iEntity, Prop_Send, "m_angRotation", fRotation); - - KillEntity(iEntity); - - Format(sSpawnBuffer, sizeof(sSpawnBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WEAPON_PAIN_PILLS_INDEX], SPAWN_SURFIX); - - iEntity = CreateEntityByName(sSpawnBuffer); - TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); - DispatchSpawn(iEntity); - SetEntityMoveType(iEntity, MOVETYPE_NONE); - - #if (DEBUG_WI) - LogMessage("[%s] Replacing start medkit with pills", WI_MODULE_NAME); - #endif - } else if (bIsInFinaleArea && Weapon_bReplaceFinaleKits) { - GetEntPropVector(iEntity, Prop_Send, "m_angRotation", fRotation); - - KillEntity(iEntity); - - Format(sSpawnBuffer, sizeof(sSpawnBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WEAPON_PAIN_PILLS_INDEX], SPAWN_SURFIX); - - iEntity = CreateEntityByName(sSpawnBuffer); - TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); - DispatchSpawn(iEntity); - SetEntityMoveType(iEntity, MOVETYPE_NONE); - - #if (DEBUG_WI) - LogMessage("[%s] Replacing finale medkit with pills", WI_MODULE_NAME); - #endif - } - - if (bIsInStartSaferoom) { - Weapon_iKitEntity[Weapon_iKitCount++] = iEntity; - - #if (DEBUG_WI) - LogMessage("[%s] Start medkit added to array", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); - #endif - } + //------------------------------------------------ + // Removal of extras + //------------------------------------------------ + // Checks if the replacement index is equal to -1 + // (WEAPON_REMOVE_INDEX) + // If so, check the cvar boolean and kill the + // weapon, minus medkits as these needs special + // care + + if (Weapon_Attributes[iWeaponIndex][ReplacementIndex] == WEAPON_REMOVE_INDEX + && Weapon_bConvar[iWeaponIndex] + && iWeaponIndex != WEAPON_FIRST_AID_KIT_INDEX + ) { + KillEntity(iEntity); + + #if (DEBUG_WI) + LogMessage("[%s] Killing weapon as requested...", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + + //------------------------------------------------ + // Check entity + //------------------------------------------------ + // Stop removing extra items that are protected + // (medkits converted to pain pills) + for (int Index = 0; Index < WEAPON_NUMBER_OF_START_KITS; Index++) { + if (Weapon_iKitEntity[Index] == iEntity) { + #if (DEBUG_WI) + LogMessage("[%s] Start kit found, save entity", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + } + + //------------------------------------------------ + // Check location + //------------------------------------------------ + // If the item is within the end safe room and its + // not finale + // OR + // If the items is within start safe room, and it + // is not a first aid kit + // Remove the item + float fOrigin[3]; + GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fOrigin); + + bool bIsInStartSaferoom = false, bIsInStartSaferoomExtra = false; + bool bIsInEndSaferoom = false, bIsInFinaleArea = false; + + float fStartDistance = GetVectorDistance(Weapon_fMapOrigin_Start, fOrigin); + + if (fStartDistance <= Weapon_fMapDist_Start) { + bIsInStartSaferoom = true; + bIsInStartSaferoomExtra = true; + } else if (fStartDistance <= Weapon_fMapDist_StartExtra) { + bIsInStartSaferoomExtra = true; + } else if (GetVectorDistance(Weapon_fMapOrigin_End, fOrigin) <= Weapon_fMapDist_End) { + if (L4D_IsMissionFinalMap()) { + bIsInFinaleArea = true; + } else { + bIsInEndSaferoom = true; + } + } + + if (Weapon_bRemoveExtraItems && + (bIsInEndSaferoom || (bIsInStartSaferoomExtra && iWeaponIndex != WEAPON_FIRST_AID_KIT_INDEX)) + ) { + KillEntity(iEntity); + + #if (DEBUG_WI) + LogMessage("[%s] Extra item is within a safe room, killing...", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + + //------------------------------------------------ + // Check for medkit + //------------------------------------------------ + // No need to go on if it is not a medkit + + if (iWeaponIndex != WEAPON_FIRST_AID_KIT_INDEX) { + #if (DEBUG_WI) + LogMessage("[%s] Not a medkit and not inside any saferoom, no need to go on", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + + //------------------------------------------------ + // Check location of medkit + //------------------------------------------------ + // If its outside the start safe room we assume + // it is a static medkit and it needs removal + + if (Weapon_bConvar[iWeaponIndex] && !bIsInStartSaferoom && !bIsInFinaleArea) { + KillEntity(iEntity); + + #if (DEBUG_WI) + LogMessage("[%s] Static medkit outside saferoom and finale, killing...", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + + if (Weapon_iKitCount >= WEAPON_NUMBER_OF_START_KITS && bIsInStartSaferoom) { + KillEntity(iEntity); + + #if (DEBUG_WI) + LogMessage("[%s] More than 4 saferoom medkits found, killing entity...", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + + return; + } + + float fRotation[3]; + char sSpawnBuffer[MAX_ENTITY_NAME_LENGTH]; + + if (bIsInStartSaferoom && Weapon_bReplaceStartKits) { + GetEntPropVector(iEntity, Prop_Send, "m_angRotation", fRotation); + + KillEntity(iEntity); + + Format(sSpawnBuffer, sizeof(sSpawnBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WEAPON_PAIN_PILLS_INDEX], SPAWN_SURFIX); + + iEntity = CreateEntityByName(sSpawnBuffer); + TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); + DispatchSpawn(iEntity); + SetEntityMoveType(iEntity, MOVETYPE_NONE); + + #if (DEBUG_WI) + LogMessage("[%s] Replacing start medkit with pills", WI_MODULE_NAME); + #endif + } else if (bIsInFinaleArea && Weapon_bReplaceFinaleKits) { + GetEntPropVector(iEntity, Prop_Send, "m_angRotation", fRotation); + + KillEntity(iEntity); + + Format(sSpawnBuffer, sizeof(sSpawnBuffer), "%s%s%s", SPAWN_PREFIX, Weapon_Spawns[WEAPON_PAIN_PILLS_INDEX], SPAWN_SURFIX); + + iEntity = CreateEntityByName(sSpawnBuffer); + TeleportEntity(iEntity, fOrigin, fRotation, NULL_VECTOR); + DispatchSpawn(iEntity); + SetEntityMoveType(iEntity, MOVETYPE_NONE); + + #if (DEBUG_WI) + LogMessage("[%s] Replacing finale medkit with pills", WI_MODULE_NAME); + #endif + } + + if (bIsInStartSaferoom) { + Weapon_iKitEntity[Weapon_iKitCount++] = iEntity; + + #if (DEBUG_WI) + LogMessage("[%s] Start medkit added to array", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); + #endif + } } //================================================ @@ -1160,24 +1160,24 @@ static void WI_ReplaceExtra(int iEntity, int iWeaponIndex) // ones we need static void WI_PrecacheModels() { - char ModelBuffer[PLATFORM_MAX_PATH]; - for (int index = FIRST_WEAPON; index <= LAST_WEAPON; index++) { - if (strlen(Weapon_Models[index]) == 0) { - continue; - } + char ModelBuffer[PLATFORM_MAX_PATH]; + for (int index = FIRST_WEAPON; index <= LAST_WEAPON; index++) { + if (strlen(Weapon_Models[index]) == 0) { + continue; + } - Format(ModelBuffer, sizeof(ModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[index], MODEL_SURFIX); + Format(ModelBuffer, sizeof(ModelBuffer), "%s%s%s", MODEL_PREFIX, Weapon_Models[index], MODEL_SURFIX); - if (IsModelPrecached(ModelBuffer)) { - continue; - } + if (IsModelPrecached(ModelBuffer)) { + continue; + } - PrecacheModel(ModelBuffer); + PrecacheModel(ModelBuffer); - #if (DEBUG_WI) - LogMessage("[%s] Model precached: %s", WI_MODULE_NAME, ModelBuffer); - #endif - } + #if (DEBUG_WI) + LogMessage("[%s] Model precached: %s", WI_MODULE_NAME, ModelBuffer); + #endif + } } //================================================ @@ -1186,111 +1186,111 @@ static void WI_PrecacheModels() // Updates the global map variables if needed static void WI_GetMapInfo() { - if (!Weapon_bUpdateMapInfo/* || !FindMapId() */) { - return; - } - - Weapon_fMapOrigin_Start[0] = GetMapStartOriginX(); - Weapon_fMapOrigin_Start[1] = GetMapStartOriginY(); - Weapon_fMapOrigin_Start[2] = GetMapStartOriginZ(); - Weapon_fMapOrigin_End[0] = GetMapEndOriginX(); - Weapon_fMapOrigin_End[1] = GetMapEndOriginY(); - Weapon_fMapOrigin_End[2] = GetMapEndOriginZ(); - Weapon_fMapDist_Start = GetMapStartDist(); - Weapon_fMapDist_StartExtra = GetMapStartExtraDist(); - Weapon_fMapDist_End = GetMapEndDist(); - - Weapon_bUpdateMapInfo = false; + if (!Weapon_bUpdateMapInfo/* || !FindMapId() */) { + return; + } + + Weapon_fMapOrigin_Start[0] = GetMapStartOriginX(); + Weapon_fMapOrigin_Start[1] = GetMapStartOriginY(); + Weapon_fMapOrigin_Start[2] = GetMapStartOriginZ(); + Weapon_fMapOrigin_End[0] = GetMapEndOriginX(); + Weapon_fMapOrigin_End[1] = GetMapEndOriginY(); + Weapon_fMapOrigin_End[2] = GetMapEndOriginZ(); + Weapon_fMapDist_Start = GetMapStartDist(); + Weapon_fMapDist_StartExtra = GetMapStartExtraDist(); + Weapon_fMapDist_End = GetMapEndDist(); + + Weapon_bUpdateMapInfo = false; } public void WI_RoundStart_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - CreateTimer(0.3, WI_RoundStartLoop, _, TIMER_FLAG_NO_MAPCHANGE); + CreateTimer(0.3, WI_RoundStartLoop, _, TIMER_FLAG_NO_MAPCHANGE); } public void WI_RoundEnd_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - Weapon_bUpdateMapInfo = true; + Weapon_bUpdateMapInfo = true; } public Action WI_RoundStartLoop(Handle hTimer) { - if (!IsPluginEnabled()) { - return Plugin_Stop; - } + if (!IsPluginEnabled()) { + return Plugin_Stop; + } - WI_GetMapInfo(); + WI_GetMapInfo(); - if (Weapon_bUpdateMapInfo) { - return Plugin_Stop; - } + if (Weapon_bUpdateMapInfo) { + return Plugin_Stop; + } - WI_PrecacheModels(); + WI_PrecacheModels(); #if (DEBUG_WI) - LogMessage("[%s] Round Start Loop( )", WI_MODULE_NAME); - LogMessage("[%s] {", WI_MODULE_NAME); + LogMessage("[%s] Round Start Loop( )", WI_MODULE_NAME); + LogMessage("[%s] {", WI_MODULE_NAME); #endif - for (int KitIndex = 0; KitIndex < WEAPON_NUMBER_OF_START_KITS; KitIndex++) { - Weapon_iKitEntity[KitIndex] = 0; - } + for (int KitIndex = 0; KitIndex < WEAPON_NUMBER_OF_START_KITS; KitIndex++) { + Weapon_iKitEntity[KitIndex] = 0; + } - Weapon_iKitCount = 0; + Weapon_iKitCount = 0; - char entclass[MAX_ENTITY_NAME_LENGTH]; - int iEntity, iWeaponIndex, entcount = GetEntityCount(); + char entclass[MAX_ENTITY_NAME_LENGTH]; + int iEntity, iWeaponIndex, entcount = GetEntityCount(); - for (iEntity = (MaxClients + 1); iEntity <= entcount; iEntity++) { - if (!IsValidEdict(iEntity)) { - continue; - } + for (iEntity = (MaxClients + 1); iEntity <= entcount; iEntity++) { + if (!IsValidEdict(iEntity)) { + continue; + } - GetEdictClassname(iEntity, entclass, sizeof(entclass)); + GetEdictClassname(iEntity, entclass, sizeof(entclass)); - iWeaponIndex = WI_GetWeaponIndex(iEntity, entclass); - if (iWeaponIndex != WEAPON_NULL_INDEX) { - if (iWeaponIndex <= LAST_WEAPON) { - WI_ReplaceWeapon(iEntity, iWeaponIndex); - } else { - WI_ReplaceExtra(iEntity, iWeaponIndex); - } - } + iWeaponIndex = WI_GetWeaponIndex(iEntity, entclass); + if (iWeaponIndex != WEAPON_NULL_INDEX) { + if (iWeaponIndex <= LAST_WEAPON) { + WI_ReplaceWeapon(iEntity, iWeaponIndex); + } else { + WI_ReplaceExtra(iEntity, iWeaponIndex); + } + } - if (Weapon_bRemoveLaserSight && StrContains(entclass, "upgrade_laser_sight") != -1) { - KillEntity(iEntity); + if (Weapon_bRemoveLaserSight && StrContains(entclass, "upgrade_laser_sight") != -1) { + KillEntity(iEntity); - #if (DEBUG_WI) - LogMessage("[%s] Killing laser sight...", WI_MODULE_NAME); - #endif + #if (DEBUG_WI) + LogMessage("[%s] Killing laser sight...", WI_MODULE_NAME); + #endif - continue; - } - } + continue; + } + } #if (DEBUG_WI) - LogMessage("[%s] Round Start Loop End", WI_MODULE_NAME); - LogMessage("[%s] }", WI_MODULE_NAME); + LogMessage("[%s] Round Start Loop End", WI_MODULE_NAME); + LogMessage("[%s] }", WI_MODULE_NAME); #endif - return Plugin_Stop; + return Plugin_Stop; } public void WI_SpawnerGiveItem_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - if (!IsPluginEnabled()) { - return; - } + if (!IsPluginEnabled()) { + return; + } - int iEntity = hEvent.GetInt("spawner"); + int iEntity = hEvent.GetInt("spawner"); - char sEntityClassName[MAX_ENTITY_NAME_LENGTH]; - GetEdictClassname(iEntity, sEntityClassName, sizeof(sEntityClassName)); + char sEntityClassName[MAX_ENTITY_NAME_LENGTH]; + GetEdictClassname(iEntity, sEntityClassName, sizeof(sEntityClassName)); - int iWeaponIndex = WI_GetWeaponIndex(iEntity, sEntityClassName); - if (iWeaponIndex == WEAPON_NULL_INDEX) { - return; - } + int iWeaponIndex = WI_GetWeaponIndex(iEntity, sEntityClassName); + if (iWeaponIndex == WEAPON_NULL_INDEX) { + return; + } - WI_ReplaceWeapon(iEntity, iWeaponIndex, true); + WI_ReplaceWeapon(iEntity, iWeaponIndex, true); } diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/configs.sp b/addons/sourcemod/scripting/confoglcompmod/includes/configs.sp index 821265e91..89fa5a7a5 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/configs.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/configs.sp @@ -1,185 +1,185 @@ #if defined __confogl_configs_included - #endinput + #endinput #endif #define __confogl_configs_included -#define CONFIGS_MODULE_NAME "Configs" +#define CONFIGS_MODULE_NAME "Configs" static const char - customCfgDir[] = "cfgogl"; + customCfgDir[] = "cfgogl"; static char - DirSeparator = '\0', - configsPath[PLATFORM_MAX_PATH] = "\0", - cfgPath[PLATFORM_MAX_PATH] = "\0", - customCfgPath[PLATFORM_MAX_PATH] = "\0", - customCfgName[PLATFORM_MAX_PATH] = "\0"; + DirSeparator = '\0', + configsPath[PLATFORM_MAX_PATH] = "\0", + cfgPath[PLATFORM_MAX_PATH] = "\0", + customCfgPath[PLATFORM_MAX_PATH] = "\0", + customCfgName[PLATFORM_MAX_PATH] = "\0"; static ConVar - hCustomConfig = null; + hCustomConfig = null; void Configs_APL() { - CreateNative("LGO_BuildConfigPath", _native_BuildConfigPath); - CreateNative("LGO_ExecuteConfigCfg", _native_ExecConfigCfg); - CreateNative("LGO_GetConfigName", _native_GetConfigName); + CreateNative("LGO_BuildConfigPath", _native_BuildConfigPath); + CreateNative("LGO_ExecuteConfigCfg", _native_ExecConfigCfg); + CreateNative("LGO_GetConfigName", _native_GetConfigName); } void Configs_OnModuleStart() { - InitPaths(); + InitPaths(); - hCustomConfig = CreateConVarEx("customcfg", "", "DONT TOUCH THIS CVAR! This is more magic bullshit!", FCVAR_DONTRECORD|FCVAR_UNLOGGED); + hCustomConfig = CreateConVarEx("customcfg", "", "DONT TOUCH THIS CVAR! This is more magic bullshit!", FCVAR_DONTRECORD|FCVAR_UNLOGGED); - char cfgString[PLATFORM_MAX_PATH]; - hCustomConfig.GetString(cfgString, sizeof(cfgString)); - SetCustomCfg(cfgString); + char cfgString[PLATFORM_MAX_PATH]; + hCustomConfig.GetString(cfgString, sizeof(cfgString)); + SetCustomCfg(cfgString); - hCustomConfig.RestoreDefault(); + hCustomConfig.RestoreDefault(); } static void InitPaths() { - BuildPath(Path_SM, configsPath, sizeof(configsPath), "configs/confogl/"); - BuildPath(Path_SM, cfgPath, sizeof(cfgPath), "../../cfg/"); + BuildPath(Path_SM, configsPath, sizeof(configsPath), "configs/confogl/"); + BuildPath(Path_SM, cfgPath, sizeof(cfgPath), "../../cfg/"); - DirSeparator = cfgPath[(strlen(cfgPath) - 1)]; + DirSeparator = cfgPath[(strlen(cfgPath) - 1)]; } bool SetCustomCfg(const char[] cfgname) { - if (!strlen(cfgname)) { - customCfgPath[0] = 0; - hCustomConfig.RestoreDefault(); - - if (IsDebugEnabled()) { - LogMessage("[%s] Custom Config Path Reset - Using Default", CONFIGS_MODULE_NAME); - } - - return true; - } - - Format(customCfgPath, sizeof(customCfgPath), "%s%s%c%s", cfgPath, customCfgDir, DirSeparator, cfgname); - if (!DirExists(customCfgPath)) { - Debug_LogError(CONFIGS_MODULE_NAME, "Custom config directory %s does not exist!", customCfgPath); - // Revert customCfgPath - customCfgPath[0] = 0; - return false; - } - - int thislen = strlen(customCfgPath); - if ((thislen + 1) < sizeof(customCfgPath)) { - customCfgPath[thislen] = DirSeparator; - customCfgPath[(thislen + 1)] = 0; - } else { - Debug_LogError(CONFIGS_MODULE_NAME, "Custom config directory %s path too long!", customCfgPath); - customCfgPath[0] = 0; - return false; - } - - strcopy(customCfgName, sizeof(customCfgName), cfgname); - hCustomConfig.SetString(cfgname); - - return true; + if (!strlen(cfgname)) { + customCfgPath[0] = 0; + hCustomConfig.RestoreDefault(); + + if (IsDebugEnabled()) { + LogMessage("[%s] Custom Config Path Reset - Using Default", CONFIGS_MODULE_NAME); + } + + return true; + } + + Format(customCfgPath, sizeof(customCfgPath), "%s%s%c%s", cfgPath, customCfgDir, DirSeparator, cfgname); + if (!DirExists(customCfgPath)) { + Debug_LogError(CONFIGS_MODULE_NAME, "Custom config directory %s does not exist!", customCfgPath); + // Revert customCfgPath + customCfgPath[0] = 0; + return false; + } + + int thislen = strlen(customCfgPath); + if ((thislen + 1) < sizeof(customCfgPath)) { + customCfgPath[thislen] = DirSeparator; + customCfgPath[(thislen + 1)] = 0; + } else { + Debug_LogError(CONFIGS_MODULE_NAME, "Custom config directory %s path too long!", customCfgPath); + customCfgPath[0] = 0; + return false; + } + + strcopy(customCfgName, sizeof(customCfgName), cfgname); + hCustomConfig.SetString(cfgname); + + return true; } void BuildConfigPath(char[] buffer, const int maxlength, const char[] sFileName) { - if (customCfgPath[0]) { - Format(buffer, maxlength, "%s%s", customCfgPath, sFileName); - - if (FileExists(buffer)) { - if (IsDebugEnabled()) { - LogMessage("[%s] Built custom config path: %s", CONFIGS_MODULE_NAME, buffer); - } - - return; - } else { - if (IsDebugEnabled()) { - LogMessage("[%s] Custom config not available: %s", CONFIGS_MODULE_NAME, buffer); - } - } - } - - Format(buffer, maxlength, "%s%s", configsPath, sFileName); - if (IsDebugEnabled()) { - LogMessage("[%s] Built default config path: %s", CONFIGS_MODULE_NAME, buffer); - } + if (customCfgPath[0]) { + Format(buffer, maxlength, "%s%s", customCfgPath, sFileName); + + if (FileExists(buffer)) { + if (IsDebugEnabled()) { + LogMessage("[%s] Built custom config path: %s", CONFIGS_MODULE_NAME, buffer); + } + + return; + } else { + if (IsDebugEnabled()) { + LogMessage("[%s] Custom config not available: %s", CONFIGS_MODULE_NAME, buffer); + } + } + } + + Format(buffer, maxlength, "%s%s", configsPath, sFileName); + if (IsDebugEnabled()) { + LogMessage("[%s] Built default config path: %s", CONFIGS_MODULE_NAME, buffer); + } } void ExecuteCfg(const char[] sFileName) { - if (strlen(sFileName) == 0) { - return; - } + if (strlen(sFileName) == 0) { + return; + } - char sFilePath[PLATFORM_MAX_PATH]; + char sFilePath[PLATFORM_MAX_PATH]; - if (customCfgPath[0]) { - Format(sFilePath, sizeof(sFilePath), "%s%s", customCfgPath, sFileName); + if (customCfgPath[0]) { + Format(sFilePath, sizeof(sFilePath), "%s%s", customCfgPath, sFileName); - if (FileExists(sFilePath)) { - if (IsDebugEnabled()) { - LogMessage("[%s] Executing custom cfg file %s", CONFIGS_MODULE_NAME, sFilePath); - } + if (FileExists(sFilePath)) { + if (IsDebugEnabled()) { + LogMessage("[%s] Executing custom cfg file %s", CONFIGS_MODULE_NAME, sFilePath); + } - ServerCommand("exec %s%s", customCfgPath[strlen(cfgPath)], sFileName); + ServerCommand("exec %s%s", customCfgPath[strlen(cfgPath)], sFileName); - return; - } else { - if (IsDebugEnabled()) { - LogMessage("[%s] Couldn't find custom cfg file %s, trying default", CONFIGS_MODULE_NAME, sFilePath); - } - } - } + return; + } else { + if (IsDebugEnabled()) { + LogMessage("[%s] Couldn't find custom cfg file %s, trying default", CONFIGS_MODULE_NAME, sFilePath); + } + } + } - Format(sFilePath, sizeof(sFilePath), "%s%s", cfgPath, sFileName); + Format(sFilePath, sizeof(sFilePath), "%s%s", cfgPath, sFileName); - if (FileExists(sFilePath)) { - if (IsDebugEnabled()) { - LogMessage("[%s] Executing default config %s", CONFIGS_MODULE_NAME, sFilePath); - } + if (FileExists(sFilePath)) { + if (IsDebugEnabled()) { + LogMessage("[%s] Executing default config %s", CONFIGS_MODULE_NAME, sFilePath); + } - ServerCommand("exec %s", sFileName); - } else { - Debug_LogError(CONFIGS_MODULE_NAME, "Could not execute server config \"%s\", file not found", sFilePath); - } + ServerCommand("exec %s", sFileName); + } else { + Debug_LogError(CONFIGS_MODULE_NAME, "Could not execute server config \"%s\", file not found", sFilePath); + } } public int _native_BuildConfigPath(Handle plugin, int numParams) { - int iLen = 0; - GetNativeStringLength(3, iLen); + int iLen = 0; + GetNativeStringLength(3, iLen); - int iNewLen = iLen + 1; - char[] sFileName = new char[iNewLen]; - GetNativeString(3, sFileName, iNewLen); + int iNewLen = iLen + 1; + char[] sFileName = new char[iNewLen]; + GetNativeString(3, sFileName, iNewLen); - iLen = GetNativeCell(2); + iLen = GetNativeCell(2); - char[] sBuf = new char[iLen]; - BuildConfigPath(sBuf, iLen, sFileName); - SetNativeString(1, sBuf, iLen); + char[] sBuf = new char[iLen]; + BuildConfigPath(sBuf, iLen, sFileName); + SetNativeString(1, sBuf, iLen); - return 1; + return 1; } public int _native_ExecConfigCfg(Handle plugin, int numParams) { - int iLen = 0; - GetNativeStringLength(1, iLen); + int iLen = 0; + GetNativeStringLength(1, iLen); - int iNewLen = iLen + 1; - char[] sFileName = new char[iNewLen]; - GetNativeString(1, sFileName, iNewLen); + int iNewLen = iLen + 1; + char[] sFileName = new char[iNewLen]; + GetNativeString(1, sFileName, iNewLen); - ExecuteCfg(sFileName); + ExecuteCfg(sFileName); - return 1; + return 1; } public int _native_GetConfigName(Handle plugin, int numParams) { - SetNativeString(1, customCfgName, GetNativeCell(2), true); - return 1; + SetNativeString(1, customCfgName, GetNativeCell(2), true); + return 1; } diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/constants.sp b/addons/sourcemod/scripting/confoglcompmod/includes/constants.sp index e4d8ecabe..04b6af918 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/constants.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/constants.sp @@ -1,116 +1,116 @@ #if defined __confogl_constants_included - #endinput + #endinput #endif #define __confogl_constants_included -#define MAX_ENTITY_NAME_LENGTH 64 +#define MAX_ENTITY_NAME_LENGTH 64 -#define NUM_OF_SURVIVORS 4 +#define NUM_OF_SURVIVORS 4 -#define START_SAFEROOM (1 << 0) -#define END_SAFEROOM (1 << 1) +#define START_SAFEROOM (1 << 0) +#define END_SAFEROOM (1 << 1) -#define SPAWNFLAG_READY 0 -#define SPAWNFLAG_CANSPAWN (0 << 0) -#define SPAWNFLAG_DISABLED (1 << 0) -#define SPAWNFLAG_WAITFORSURVIVORS (1 << 1) -#define SPAWNFLAG_WAITFORFINALE (1 << 2) -#define SPAWNFLAG_WAITFORTANKTODIE (1 << 3) -#define SPAWNFLAG_SURVIVORESCAPED (1 << 4) -#define SPAWNFLAG_DIRECTORTIMEOUT (1 << 5) -#define SPAWNFLAG_WAITFORNEXTWAVE (1 << 6) -#define SPAWNFLAG_CANBESEEN (1 << 7) -#define SPAWNFLAG_TOOCLOSE (1 << 8) -#define SPAWNFLAG_RESTRICTEDAREA (1 << 9) -#define SPAWNFLAG_BLOCKED (1 << 10) +#define SPAWNFLAG_READY 0 +#define SPAWNFLAG_CANSPAWN (0 << 0) +#define SPAWNFLAG_DISABLED (1 << 0) +#define SPAWNFLAG_WAITFORSURVIVORS (1 << 1) +#define SPAWNFLAG_WAITFORFINALE (1 << 2) +#define SPAWNFLAG_WAITFORTANKTODIE (1 << 3) +#define SPAWNFLAG_SURVIVORESCAPED (1 << 4) +#define SPAWNFLAG_DIRECTORTIMEOUT (1 << 5) +#define SPAWNFLAG_WAITFORNEXTWAVE (1 << 6) +#define SPAWNFLAG_CANBESEEN (1 << 7) +#define SPAWNFLAG_TOOCLOSE (1 << 8) +#define SPAWNFLAG_RESTRICTEDAREA (1 << 9) +#define SPAWNFLAG_BLOCKED (1 << 10) enum { - L4D2Team_None = 0, - L4D2Team_Spectator, - L4D2Team_Survivor, - L4D2Team_Infected, - L4D2Team_L4D1_Survivor, // Probably for maps that contain survivors from the first part and from part 2 + L4D2Team_None = 0, + L4D2Team_Spectator, + L4D2Team_Survivor, + L4D2Team_Infected, + L4D2Team_L4D1_Survivor, // Probably for maps that contain survivors from the first part and from part 2 - L4D2Team_Size // 5 size + L4D2Team_Size // 5 size }; enum { - L4D2Infected_Common = 0, - L4D2Infected_Smoker = 1, - L4D2Infected_Boomer, - L4D2Infected_Hunter, - L4D2Infected_Spitter, - L4D2Infected_Jockey, - L4D2Infected_Charger, - L4D2Infected_Witch, - L4D2Infected_Tank, - L4D2Infected_Survivor, - - L4D2Infected_Size //10 size + L4D2Infected_Common = 0, + L4D2Infected_Smoker = 1, + L4D2Infected_Boomer, + L4D2Infected_Hunter, + L4D2Infected_Spitter, + L4D2Infected_Jockey, + L4D2Infected_Charger, + L4D2Infected_Witch, + L4D2Infected_Tank, + L4D2Infected_Survivor, + + L4D2Infected_Size //10 size }; enum { - L4D2WeaponSlot_Primary = 0, - L4D2WeaponSlot_Secondary, - L4D2WeaponSlot_Throwable, - L4D2WeaponSlot_HeavyHealthItem, - L4D2WeaponSlot_LightHealthItem, - - L4D2WeaponSlot_Size //5 size + L4D2WeaponSlot_Primary = 0, + L4D2WeaponSlot_Secondary, + L4D2WeaponSlot_Throwable, + L4D2WeaponSlot_HeavyHealthItem, + L4D2WeaponSlot_LightHealthItem, + + L4D2WeaponSlot_Size //5 size }; enum /*WeaponIDs*/ { - WEPID_PISTOL = 1, - WEPID_SMG, // 2 - WEPID_PUMPSHOTGUN, // 3 - WEPID_AUTOSHOTGUN, // 4 - WEPID_RIFLE, // 5 - WEPID_HUNTING_RIFLE, // 6 - WEPID_SMG_SILENCED, // 7 - WEPID_SHOTGUN_CHROME, // 8 - WEPID_RIFLE_DESERT, // 9 - WEPID_SNIPER_MILITARY, // 10 - WEPID_SHOTGUN_SPAS, // 11 - WEPID_FIRST_AID_KIT, // 12 - WEPID_MOLOTOV, // 13 - WEPID_PIPE_BOMB, // 14 - WEPID_PAIN_PILLS, // 15 - WEPID_GASCAN, // 16 - WEPID_PROPANE_TANK, // 17 - WEPID_AIR_CANISTER, // 18 - WEPID_CHAINSAW = 20, - WEPID_GRENADE_LAUNCHER, // 21 - WEPID_ADRENALINE = 23, - WEPID_DEFIBRILLATOR, // 24 - WEPID_VOMITJAR, // 25 - WEPID_RIFLE_AK47, // 26 - WEPID_GNOME_CHOMPSKI, // 27 - WEPID_COLA_BOTTLES, // 28 - WEPID_FIREWORKS_BOX, // 29 - WEPID_INCENDIARY_AMMO, // 30 - WEPID_FRAG_AMMO, // 31 - WEPID_PISTOL_MAGNUM, // 32 - WEPID_SMG_MP5, // 33 - WEPID_RIFLE_SG552, // 34 - WEPID_SNIPER_AWP, // 35 - WEPID_SNIPER_SCOUT, // 36 - WEPID_RIFLE_M60, // 37 + WEPID_PISTOL = 1, + WEPID_SMG, // 2 + WEPID_PUMPSHOTGUN, // 3 + WEPID_AUTOSHOTGUN, // 4 + WEPID_RIFLE, // 5 + WEPID_HUNTING_RIFLE, // 6 + WEPID_SMG_SILENCED, // 7 + WEPID_SHOTGUN_CHROME, // 8 + WEPID_RIFLE_DESERT, // 9 + WEPID_SNIPER_MILITARY, // 10 + WEPID_SHOTGUN_SPAS, // 11 + WEPID_FIRST_AID_KIT, // 12 + WEPID_MOLOTOV, // 13 + WEPID_PIPE_BOMB, // 14 + WEPID_PAIN_PILLS, // 15 + WEPID_GASCAN, // 16 + WEPID_PROPANE_TANK, // 17 + WEPID_AIR_CANISTER, // 18 + WEPID_CHAINSAW = 20, + WEPID_GRENADE_LAUNCHER, // 21 + WEPID_ADRENALINE = 23, + WEPID_DEFIBRILLATOR, // 24 + WEPID_VOMITJAR, // 25 + WEPID_RIFLE_AK47, // 26 + WEPID_GNOME_CHOMPSKI, // 27 + WEPID_COLA_BOTTLES, // 28 + WEPID_FIREWORKS_BOX, // 29 + WEPID_INCENDIARY_AMMO, // 30 + WEPID_FRAG_AMMO, // 31 + WEPID_PISTOL_MAGNUM, // 32 + WEPID_SMG_MP5, // 33 + WEPID_RIFLE_SG552, // 34 + WEPID_SNIPER_AWP, // 35 + WEPID_SNIPER_SCOUT, // 36 + WEPID_RIFLE_M60, // 37 - WEPID_SIZE + WEPID_SIZE }; /*stock const char g_sTeamName[8][] = { - "Spectator", - "" , - "Survivor", - "Infected", - "", - "Infected", - "Survivors", - "Infected" + "Spectator", + "" , + "Survivor", + "Infected", + "", + "Infected", + "Survivors", + "Infected" };*/ diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/customtags.sp b/addons/sourcemod/scripting/confoglcompmod/includes/customtags.sp index df0d0cc7f..35670fa87 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/customtags.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/customtags.sp @@ -1,105 +1,105 @@ #if defined __confogl_customtags_included - #endinput + #endinput #endif #define __confogl_customtags_included // COPYRIGHT PSYCHONIC // USED WITH PERMISSION -#define CT_MODULE_NAME "CustomTags" +#define CT_MODULE_NAME "CustomTags" #define SV_TAG_SIZE 64 static stock bool - are_tags_hooked = false, - ignore_next_change = false; + are_tags_hooked = false, + ignore_next_change = false; static stock ConVar - sv_tags = null; + sv_tags = null; static stock ArrayList - custom_tags = null; + custom_tags = null; void CT_OnModuleStart() { - custom_tags = new ArrayList(ByteCountToCells(SV_TAG_SIZE)); + custom_tags = new ArrayList(ByteCountToCells(SV_TAG_SIZE)); - sv_tags = FindConVar("sv_tags"); + sv_tags = FindConVar("sv_tags"); } stock void AddCustomServerTag(const char[] tag) { - if (custom_tags.FindString(tag) == -1) { - custom_tags.PushString(tag); - } + if (custom_tags.FindString(tag) == -1) { + custom_tags.PushString(tag); + } - char current_tags[SV_TAG_SIZE]; - sv_tags.GetString(current_tags, sizeof(current_tags)); + char current_tags[SV_TAG_SIZE]; + sv_tags.GetString(current_tags, sizeof(current_tags)); - if (StrContains(current_tags, tag) > -1) { - // already have tag - return; - } + if (StrContains(current_tags, tag) > -1) { + // already have tag + return; + } - char new_tags[SV_TAG_SIZE]; - Format(new_tags, sizeof(new_tags), "%s%s%s", current_tags, (current_tags[0] != 0) ? "," : "", tag); + char new_tags[SV_TAG_SIZE]; + Format(new_tags, sizeof(new_tags), "%s%s%s", current_tags, (current_tags[0] != 0) ? "," : "", tag); - int flags = sv_tags.Flags; - sv_tags.Flags = flags & ~FCVAR_NOTIFY; + int flags = sv_tags.Flags; + sv_tags.Flags = flags & ~FCVAR_NOTIFY; - ignore_next_change = true; - sv_tags.SetString(new_tags); - ignore_next_change = false; + ignore_next_change = true; + sv_tags.SetString(new_tags); + ignore_next_change = false; - sv_tags.Flags = flags; + sv_tags.Flags = flags; - if (!are_tags_hooked) { - sv_tags.AddChangeHook(OnTagsChanged); - are_tags_hooked = true; - } + if (!are_tags_hooked) { + sv_tags.AddChangeHook(OnTagsChanged); + are_tags_hooked = true; + } } stock void RemoveCustomServerTag(const char[] tag) { - int idx = custom_tags.FindString(tag); - if (idx > -1) { - custom_tags.Erase(idx); - } + int idx = custom_tags.FindString(tag); + if (idx > -1) { + custom_tags.Erase(idx); + } - char current_tags[SV_TAG_SIZE]; - sv_tags.GetString(current_tags, sizeof(current_tags)); + char current_tags[SV_TAG_SIZE]; + sv_tags.GetString(current_tags, sizeof(current_tags)); - if (StrContains(current_tags, tag) == -1) { - // tag isn't on here, just bug out - return; - } + if (StrContains(current_tags, tag) == -1) { + // tag isn't on here, just bug out + return; + } - ReplaceString(current_tags, sizeof(current_tags), tag, ""); - ReplaceString(current_tags, sizeof(current_tags), ",,", ""); + ReplaceString(current_tags, sizeof(current_tags), tag, ""); + ReplaceString(current_tags, sizeof(current_tags), ",,", ""); - int flags = sv_tags.Flags; - sv_tags.Flags = flags & ~FCVAR_NOTIFY; + int flags = sv_tags.Flags; + sv_tags.Flags = flags & ~FCVAR_NOTIFY; - ignore_next_change = true; - sv_tags.SetString(current_tags); - ignore_next_change = false; + ignore_next_change = true; + sv_tags.SetString(current_tags); + ignore_next_change = false; - sv_tags.Flags = flags; + sv_tags.Flags = flags; } public void OnTagsChanged(ConVar hConvar, const char[] sOldValue, const char[] sNewValue) { - if (ignore_next_change) { - // we fired this callback, no need to reapply tags - return; - } - - // reapply each custom tag - char tag[SV_TAG_SIZE]; - int iSize = custom_tags.Length; - - for (int i = 0; i < iSize; i++) { - custom_tags.GetString(i, tag, sizeof(tag)); - AddCustomServerTag(tag); - } + if (ignore_next_change) { + // we fired this callback, no need to reapply tags + return; + } + + // reapply each custom tag + char tag[SV_TAG_SIZE]; + int iSize = custom_tags.Length; + + for (int i = 0; i < iSize; i++) { + custom_tags.GetString(i, tag, sizeof(tag)); + AddCustomServerTag(tag); + } } diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/debug.sp b/addons/sourcemod/scripting/confoglcompmod/includes/debug.sp index 7b6199262..c6583c396 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/debug.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/debug.sp @@ -1,77 +1,80 @@ #if defined __confogl_debug_included - #endinput + #endinput #endif #define __confogl_debug_included #if DEBUG_ALL - #define DEBUG_DEFAULT "1" + #define DEBUG_DEFAULT "1" #else - #define DEBUG_DEFAULT "0" + #define DEBUG_DEFAULT "0" #endif static char - g_sLogAction[256]; + g_sLogAction[256]; static bool - g_bConfoglDebug = false; + g_bConfoglDebug = false; static ConVar - g_hCvarCustomErrorLog = null, - g_hCvarDebugConVar = null; + g_hCvarCustomErrorLog = null, + g_hCvarDebugConVar = null; void Debug_OnModuleStart() { - g_hCvarDebugConVar = CreateConVarEx("debug", DEBUG_DEFAULT, "Turn on Debug Logging in all Confogl Modules", _, true, 0.0, true, 1.0); - - //confogl_custom_error_logs - g_hCvarCustomErrorLog = CreateConVarEx( \ - "custom_error_logs", \ - "1", \ - "Write logs to custom error log file (0 - use sourcemod error log file, 1 - use custom error log file)", \ - _, true, 0.0, true, 1.0 \ - ); - - g_bConfoglDebug = g_hCvarDebugConVar.BoolValue; - g_hCvarDebugConVar.AddChangeHook(Debug_ConVarChange); - - char sTime[64], sBuffer[64]; - FormatTime(sTime, sizeof(sTime), "%Y%m%d"); - FormatEx(sBuffer, sizeof(sBuffer), "logs/confoglcompmod/errors_%s.log", sTime); //errors_20211201.log - BuildPath(Path_SM, g_sLogAction, sizeof(g_sLogAction), sBuffer); - - BuildPath(Path_SM, sBuffer, sizeof(sBuffer), "logs/confoglcompmod"); - if (!DirExists(sBuffer)) { - CreateDirectory(sBuffer, 511); - } + g_hCvarDebugConVar = CreateConVarEx("debug", DEBUG_DEFAULT, "Turn on Debug Logging in all Confogl Modules", _, true, 0.0, true, 1.0); + + //confogl_custom_error_logs + g_hCvarCustomErrorLog = CreateConVarEx( \ + "custom_error_logs", \ + "1", \ + "Write logs to custom error log file (0 - use sourcemod error log file, 1 - use custom error log file)", \ + _, true, 0.0, true, 1.0 \ + ); + + g_bConfoglDebug = g_hCvarDebugConVar.BoolValue; + g_hCvarDebugConVar.AddChangeHook(Debug_ConVarChange); + + char sTime[64], sBuffer[64]; + FormatTime(sTime, sizeof(sTime), "%Y%m%d"); + FormatEx(sBuffer, sizeof(sBuffer), "logs/confoglcompmod/errors_%s.log", sTime); //errors_20211201.log + BuildPath(Path_SM, g_sLogAction, sizeof(g_sLogAction), sBuffer); + + BuildPath(Path_SM, sBuffer, sizeof(sBuffer), "logs/confoglcompmod"); + if (!DirExists(sBuffer)) { + CreateDirectory(sBuffer, 511); + } } public void Debug_ConVarChange(ConVar hConvar, const char[] sOldValue, const char[] sNewValue) { - g_bConfoglDebug = hConvar.BoolValue; + g_bConfoglDebug = hConvar.BoolValue; } stock bool IsDebugEnabled() { - return (g_bConfoglDebug || DEBUG_ALL); + return (g_bConfoglDebug || DEBUG_ALL); } stock void Debug_LogError(const char[] sModuleName, const char[] sMessage, any ...) { - static char sFormat[512]; - VFormat(sFormat, sizeof(sFormat), sMessage, 3); + static char sFormat[512]; + VFormat(sFormat, sizeof(sFormat), sMessage, 3); - static char sMap[64]; - GetCurrentMap(sMap, sizeof(sMap)); + static char sMap[64]; + GetCurrentMap(sMap, sizeof(sMap)); - Format(sFormat, sizeof(sFormat), "[%s] [%s] %s", sModuleName, sMap, sFormat); + static char sMatchName[32]; + GetMatchName(sMatchName, sizeof(sMatchName)); - if (!g_hCvarCustomErrorLog.BoolValue) { - // L 12/16/2021 - 12:10:15: [confoglcompmod.smx] [CvarSettings] [c4m1_milltown_a] Could not find CVar specified (l4d2_meleecontrol_enable) - LogError(sFormat); - return; - } + Format(sFormat, sizeof(sFormat), "[%s] [%s] [%s] %s", sModuleName, sMatchName, sMap, sFormat); - // Same as LogToFile(), except no plugin logtag is prepended. - // L 12/16/2021 - 12:11:45: [CvarSettings] [c4m1_milltown_a] Could not find CVar specified (l4d2_meleecontrol_enable) - LogToFileEx(g_sLogAction, sFormat); + if (!g_hCvarCustomErrorLog.BoolValue) { + // L 12/16/2021 - 12:10:15: [confoglcompmod.smx] [CvarSettings] [c4m1_milltown_a] Could not find CVar specified (l4d2_meleecontrol_enable) + LogError(sFormat); + return; + } + + // Same as LogToFile(), except no plugin logtag is prepended. + // L 12/16/2021 - 12:11:45: [CvarSettings] [c4m1_milltown_a] Could not find CVar specified (l4d2_meleecontrol_enable) + LogToFileEx(g_sLogAction, sFormat); } diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/functions.sp b/addons/sourcemod/scripting/confoglcompmod/includes/functions.sp index 5c498dc0a..ae512a40c 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/functions.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/functions.sp @@ -1,201 +1,201 @@ #if defined __confogl_functions_included - #endinput + #endinput #endif #define __confogl_functions_included -#define CVAR_PREFIX "confogl_" -#define CVAR_FLAGS FCVAR_NONE -#define CVAR_PRIVATE (FCVAR_DONTRECORD|FCVAR_PROTECTED) +#define CVAR_PREFIX "confogl_" +#define CVAR_FLAGS FCVAR_NONE +#define CVAR_PRIVATE (FCVAR_DONTRECORD|FCVAR_PROTECTED) static ConVar - g_hCvarMpGameMode = null, - g_hCvarPainPillsDecayRate = null; + g_hCvarMpGameMode = null, + g_hCvarPainPillsDecayRate = null; static bool - bIsPluginEnabled = false; + bIsPluginEnabled = false; void Fns_OnModuleStart() { - g_hCvarMpGameMode = FindConVar("mp_gamemode"); - g_hCvarPainPillsDecayRate = FindConVar("pain_pills_decay_rate"); + g_hCvarMpGameMode = FindConVar("mp_gamemode"); + g_hCvarPainPillsDecayRate = FindConVar("pain_pills_decay_rate"); } stock ConVar CreateConVarEx(const char[] name, const char[] defaultValue, const char[] description = "", int flags = FCVAR_NONE, \ - bool hasMin = false, float min = 0.0, bool hasMax = false, float max = 0.0) + bool hasMin = false, float min = 0.0, bool hasMax = false, float max = 0.0) { - char sBuffer[128]; - ConVar cvar = null; + char sBuffer[128]; + ConVar cvar = null; - Format(sBuffer, sizeof(sBuffer), "%s%s", CVAR_PREFIX, name); - flags = flags | CVAR_FLAGS; - cvar = CreateConVar(sBuffer, defaultValue, description, flags, hasMin, min, hasMax, max); + Format(sBuffer, sizeof(sBuffer), "%s%s", CVAR_PREFIX, name); + flags = flags | CVAR_FLAGS; + cvar = CreateConVar(sBuffer, defaultValue, description, flags, hasMin, min, hasMax, max); - return cvar; + return cvar; } stock ConVar FindConVarEx(const char[] name) { - char sBuffer[128]; - Format(sBuffer, sizeof(sBuffer), "%s%s", CVAR_PREFIX, name); + char sBuffer[128]; + Format(sBuffer, sizeof(sBuffer), "%s%s", CVAR_PREFIX, name); - return FindConVar(sBuffer); + return FindConVar(sBuffer); } stock bool IsHumansOnServer() { - for (int i = 1; i <= MaxClients; i++) { - if (IsClientConnected(i) && !IsFakeClient(i)) { - return true; - } - } + for (int i = 1; i <= MaxClients; i++) { + if (IsClientConnected(i) && !IsFakeClient(i)) { + return true; + } + } - return false; + return false; } stock bool IsVersus() { - char GameMode[32]; - g_hCvarMpGameMode.GetString(GameMode, sizeof(GameMode)); - return (StrContains(GameMode, "versus", false) != -1); + char GameMode[32]; + g_hCvarMpGameMode.GetString(GameMode, sizeof(GameMode)); + return (StrContains(GameMode, "versus", false) != -1); } /*stock bool IsScavenge() { - char GameMode[32]; - g_hCvarMpGameMode.GetString(GameMode, sizeof(GameMode)); - return (StrContains(GameMode, "scavenge", false) != -1); + char GameMode[32]; + g_hCvarMpGameMode.GetString(GameMode, sizeof(GameMode)); + return (StrContains(GameMode, "scavenge", false) != -1); }*/ stock bool IsPluginEnabled(bool bSetStatus = false, bool bStatus = false) { - if (bSetStatus) { - bIsPluginEnabled = bStatus; - } + if (bSetStatus) { + bIsPluginEnabled = bStatus; + } - return bIsPluginEnabled; + return bIsPluginEnabled; } stock int GetSurvivorPermanentHealth(int client) { - return GetEntProp(client, Prop_Send, "m_iHealth"); + return GetEntProp(client, Prop_Send, "m_iHealth"); } stock int GetSurvivorTempHealth(int client) { - float fHealthBuffer = GetEntPropFloat(client, Prop_Send, "m_healthBuffer"); - float fHealthBufferDuration = GetGameTime() - GetEntPropFloat(client, Prop_Send, "m_healthBufferTime"); + float fHealthBuffer = GetEntPropFloat(client, Prop_Send, "m_healthBuffer"); + float fHealthBufferDuration = GetGameTime() - GetEntPropFloat(client, Prop_Send, "m_healthBufferTime"); - int iTempHp = RoundToCeil(fHealthBuffer - (fHealthBufferDuration * g_hCvarPainPillsDecayRate.FloatValue)) - 1; + int iTempHp = RoundToCeil(fHealthBuffer - (fHealthBufferDuration * g_hCvarPainPillsDecayRate.FloatValue)) - 1; - return (iTempHp > 0) ? iTempHp : 0; + return (iTempHp > 0) ? iTempHp : 0; } stock int GetSurvivorIncapCount(int client) { - return GetEntProp(client, Prop_Send, "m_currentReviveCount"); + return GetEntProp(client, Prop_Send, "m_currentReviveCount"); } stock bool IsSurvivor(int client) { - return (IsClientInGame(client) && GetClientTeam(client) == L4D2Team_Survivor); + return (IsClientInGame(client) && GetClientTeam(client) == L4D2Team_Survivor); } stock void ZeroVector(float vector[3]) { - vector = NULL_VECTOR; + vector = NULL_VECTOR; } stock void AddToVector(float to[3], float from[3]) { - to[0] += from[0]; - to[1] += from[1]; - to[2] += from[2]; + to[0] += from[0]; + to[1] += from[1]; + to[2] += from[2]; } stock void CopyVector(float to[3], float from[3]) { - to = from; + to = from; } stock int GetURandomIntRange(int min, int max) { - return RoundToNearest((GetURandomFloat() * (max - min)) + min); + return RoundToNearest((GetURandomFloat() * (max - min)) + min); } stock void KillEntity(int iEntity) { #if SOURCEMOD_V_MINOR > 8 - RemoveEntity(iEntity); + RemoveEntity(iEntity); #else - AcceptEntityInput(iEntity, "Kill"); + AcceptEntityInput(iEntity, "Kill"); #endif } /** * Finds the first occurrence of a pattern in another string. * - * @param str String to search in. - * @param pattern String pattern to search for - * @param reverse False (default) to search forward, true to search - * backward. - * @return The index of the first character of the first - * occurrence of the pattern in the string, or -1 if the - * character was not found. + * @param str String to search in. + * @param pattern String pattern to search for + * @param reverse False (default) to search forward, true to search + * backward. + * @return The index of the first character of the first + * occurrence of the pattern in the string, or -1 if the + * character was not found. */ /*stock int FindPatternInString(const char[] str, const char[] pattern, bool reverse = false) { - int i = 0, len = strlen(pattern); - char c = pattern[0]; + int i = 0, len = strlen(pattern); + char c = pattern[0]; - while (i < len && (i = FindCharInString(str[i], c, reverse)) != -1) { - if (strncmp(str[i], pattern, len)) { - return i; - } - } + while (i < len && (i = FindCharInString(str[i], c, reverse)) != -1) { + if (strncmp(str[i], pattern, len)) { + return i; + } + } - return -1; + return -1; }*/ /** * Counts the number of occurences of pattern in another string. * - * @param str String to search in. - * @param pattern String pattern to search for - * @param overlap False (default) to count only non-overlapping - * occurences, true to count matches within other - * occurences. - * @return The number of occurences of the pattern in the string + * @param str String to search in. + * @param pattern String pattern to search for + * @param overlap False (default) to count only non-overlapping + * occurences, true to count matches within other + * occurences. + * @return The number of occurences of the pattern in the string */ /*stock int CountPatternsInString(const char[] str, const char[] pattern, bool overlap = false) { - int off = 0, i = 0, delta = 0, cnt = 0; - int len = strlen(str); + int off = 0, i = 0, delta = 0, cnt = 0; + int len = strlen(str); - delta = (overlap) ? strlen(pattern) : 1; + delta = (overlap) ? strlen(pattern) : 1; - while (i < len && (off = FindPatternInString(str[i], pattern)) != -1) { - cnt++; - i += off + delta; - } + while (i < len && (off = FindPatternInString(str[i], pattern)) != -1) { + cnt++; + i += off + delta; + } - return cnt; + return cnt; }*/ /** * Counts the number of occurences of pattern in another string. * - * @param str String to search in. - * @param c Character to search for. - * @return The number of occurences of the pattern in the string + * @param str String to search in. + * @param c Character to search for. + * @return The number of occurences of the pattern in the string */ /*stock int CountCharsInString(const char[] str, int c) { - int off, i, cnt, len = strlen(str); + int off, i, cnt, len = strlen(str); - while (i < len && (off = FindCharInString(str[i], c)) != -1) { - cnt++; - i += off + 1; - } + while (i < len && (off = FindCharInString(str[i], c)) != -1) { + cnt++; + i += off + 1; + } - return cnt; + return cnt; }*/ diff --git a/addons/sourcemod/scripting/confoglcompmod/includes/survivorindex.sp b/addons/sourcemod/scripting/confoglcompmod/includes/survivorindex.sp index 74e28e0cb..5d7fd1291 100644 --- a/addons/sourcemod/scripting/confoglcompmod/includes/survivorindex.sp +++ b/addons/sourcemod/scripting/confoglcompmod/includes/survivorindex.sp @@ -1,98 +1,98 @@ #if defined __confogl_survivor_index_included - #endinput + #endinput #endif #define __confogl_survivor_index_included -#define SI_MODULE_NAME "SurvivorIndex" +#define SI_MODULE_NAME "SurvivorIndex" static int - iSurvivorIndex[NUM_OF_SURVIVORS] = {0, ...}; + iSurvivorIndex[NUM_OF_SURVIVORS] = {0, ...}; void SI_OnModuleStart() { - HookEvent("round_start", SI_BuildIndex_Event, EventHookMode_PostNoCopy); - HookEvent("round_end", SI_BuildIndex_Event, EventHookMode_PostNoCopy); - HookEvent("player_spawn", SI_BuildIndex_Event, EventHookMode_PostNoCopy); - HookEvent("player_disconnect", SI_BuildIndex_Event, EventHookMode_PostNoCopy); - HookEvent("player_death", SI_BuildIndex_Event, EventHookMode_PostNoCopy); - HookEvent("player_bot_replace", SI_BuildIndex_Event, EventHookMode_PostNoCopy); - HookEvent("bot_player_replace", SI_BuildIndex_Event, EventHookMode_PostNoCopy); - HookEvent("defibrillator_used", SI_BuildIndex_Event, EventHookMode_PostNoCopy); - HookEvent("player_team", SI_BuildIndexDelay_Event, EventHookMode_PostNoCopy); + HookEvent("round_start", SI_BuildIndex_Event, EventHookMode_PostNoCopy); + HookEvent("round_end", SI_BuildIndex_Event, EventHookMode_PostNoCopy); + HookEvent("player_spawn", SI_BuildIndex_Event, EventHookMode_PostNoCopy); + HookEvent("player_disconnect", SI_BuildIndex_Event, EventHookMode_PostNoCopy); + HookEvent("player_death", SI_BuildIndex_Event, EventHookMode_PostNoCopy); + HookEvent("player_bot_replace", SI_BuildIndex_Event, EventHookMode_PostNoCopy); + HookEvent("bot_player_replace", SI_BuildIndex_Event, EventHookMode_PostNoCopy); + HookEvent("defibrillator_used", SI_BuildIndex_Event, EventHookMode_PostNoCopy); + HookEvent("player_team", SI_BuildIndexDelay_Event, EventHookMode_PostNoCopy); } static void SI_BuildIndex() { - if (!IsServerProcessing() || !IsPluginEnabled()) { - return; - } + if (!IsServerProcessing() || !IsPluginEnabled()) { + return; + } - int ifoundsurvivors = 0, character = 0; + int ifoundsurvivors = 0, character = 0; - // Make sure kicked survivors don't freak us out. - for (int i = 0; i < NUM_OF_SURVIVORS; i++) { - iSurvivorIndex[i] = 0; - } + // Make sure kicked survivors don't freak us out. + for (int i = 0; i < NUM_OF_SURVIVORS; i++) { + iSurvivorIndex[i] = 0; + } - for (int client = 1; client <= MaxClients; client++) { - if (ifoundsurvivors == NUM_OF_SURVIVORS) { - break; - } + for (int client = 1; client <= MaxClients; client++) { + if (ifoundsurvivors == NUM_OF_SURVIVORS) { + break; + } - if (!IsClientInGame(client) || GetClientTeam(client) != L4D2Team_Survivor) { - continue; - } + if (!IsClientInGame(client) || GetClientTeam(client) != L4D2Team_Survivor) { + continue; + } - character = GetEntProp(client, Prop_Send, "m_survivorCharacter"); - ifoundsurvivors++; + character = GetEntProp(client, Prop_Send, "m_survivorCharacter"); + ifoundsurvivors++; - if (character > 3 || character < 0) { - continue; - } + if (character > 3 || character < 0) { + continue; + } - iSurvivorIndex[character] = 0; + iSurvivorIndex[character] = 0; - if (!IsPlayerAlive(client)) { - continue; - } + if (!IsPlayerAlive(client)) { + continue; + } - iSurvivorIndex[character] = client; - } + iSurvivorIndex[character] = client; + } } public void SI_BuildIndexDelay_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - CreateTimer(0.3, SI_BuildIndex_Timer, _, TIMER_FLAG_NO_MAPCHANGE); + CreateTimer(0.3, SI_BuildIndex_Timer, _, TIMER_FLAG_NO_MAPCHANGE); } public Action SI_BuildIndex_Timer(Handle hTimer) { - SI_BuildIndex(); + SI_BuildIndex(); - return Plugin_Stop; + return Plugin_Stop; } public void SI_BuildIndex_Event(Event hEvent, const char[] sEventName, bool bDontBroadcast) { - SI_BuildIndex(); + SI_BuildIndex(); } stock int GetSurvivorIndex(int index) { - if (index < 0 || index > 3) { - return 0; - } + if (index < 0 || index > 3) { + return 0; + } - return iSurvivorIndex[index]; + return iSurvivorIndex[index]; } stock bool IsAnySurvivorsAlive() { - for (int index = 0; index < NUM_OF_SURVIVORS; index++) { - if (iSurvivorIndex[index]) { - return true; - } - } + for (int index = 0; index < NUM_OF_SURVIVORS; index++) { + if (iSurvivorIndex[index]) { + return true; + } + } - return false; + return false; } diff --git a/addons/sourcemod/scripting/match_vote.sp b/addons/sourcemod/scripting/match_vote.sp index 2daf53c45..b9427d324 100644 --- a/addons/sourcemod/scripting/match_vote.sp +++ b/addons/sourcemod/scripting/match_vote.sp @@ -7,541 +7,351 @@ #include #include -#define TEAM_SPECTATE 1 -#define MATCHMODES_PATH "configs/matchmodes.txt" +#define TEAM_SPECTATE 1 +#define MATCHMODES_PATH "configs/matchmodes.txt" Handle - g_hVote = null; + g_hVote = null; KeyValues - g_hModesKV = null; + g_hModesKV = null; ConVar - g_hEnabled = null, - g_hCvarPlayerLimit = null, - g_hMaxPlayers = null, - g_hSvMaxPlayers = null; + g_hEnabled = null, + g_hCvarPlayerLimit = null; char - g_sCfg[32]; + g_sCfg[32]; bool - g_bIsConfoglAvailable = false, - g_bOnSet = false, - g_bCedaGame = false; + g_bIsConfoglAvailable = false, + g_bCedaGame = false; public Plugin myinfo = { - name = "Match Vote", - author = "vintik, Sir, StarterX4", - description = "!match !rmatch !chmatch - Change Hostname and Slots while you're at it!", - version = "1.3", - url = "https://github.com/L4D-Community/L4D2-Competitive-Framework" + name = "Match Vote", + author = "vintik, Sir, StarterX4", + description = "!match !rmatch !chmatch - Change Hostname and Slots while you're at it!", + version = "1.3", + url = "https://github.com/L4D-Community/L4D2-Competitive-Framework" }; public APLRes AskPluginLoad2(Handle hMyself, bool bLate, char[] sError, int iErrMax) { - EngineVersion iEngine = GetEngineVersion(); - if (iEngine != Engine_Left4Dead2) { - strcopy(sError, iErrMax, "Plugin only supports Left 4 Dead 2."); - return APLRes_SilentFailure; - } + EngineVersion iEngine = GetEngineVersion(); + if (iEngine != Engine_Left4Dead2) { + strcopy(sError, iErrMax, "Plugin only supports Left 4 Dead 2."); + return APLRes_SilentFailure; + } - return APLRes_Success; + return APLRes_Success; } public void OnPluginStart() { - char sBuffer[PLATFORM_MAX_PATH ]; - g_hModesKV = new KeyValues("MatchModes"); - BuildPath(Path_SM, sBuffer, sizeof(sBuffer), MATCHMODES_PATH); + char sBuffer[PLATFORM_MAX_PATH ]; + g_hModesKV = new KeyValues("MatchModes"); + BuildPath(Path_SM, sBuffer, sizeof(sBuffer), MATCHMODES_PATH); - if (!g_hModesKV.ImportFromFile(sBuffer)) { - SetFailState("Couldn't load matchmodes.txt!"); - } + if (!g_hModesKV.ImportFromFile(sBuffer)) { + SetFailState("Couldn't load matchmodes.txt!"); + } - g_hEnabled = CreateConVar("sm_match_vote_enabled", "1", "Plugin enabled", _, true, 0.0, true, 1.0); - g_hMaxPlayers = CreateConVar("mv_maxplayers", "30", "How many slots would you like the Server to be at Config Load/Unload?", _, true, 1.0, true, 32.0); - g_hCvarPlayerLimit = CreateConVar("sm_match_player_limit", "1", "Minimum # of players in game to start the vote", _, true, 1.0, true, 32.0); + g_hEnabled = CreateConVar("sm_match_vote_enabled", "1", "Plugin enabled", _, true, 0.0, true, 1.0); - RegConsoleCmd("sm_match", MatchRequest); - RegConsoleCmd("sm_chmatch", ChangeMatchRequest); - RegConsoleCmd("sm_rmatch", MatchReset); + g_hCvarPlayerLimit = CreateConVar("sm_match_player_limit", "1", "Minimum # of players in game to start the vote", _, true, 1.0, true, 32.0); - g_hSvMaxPlayers = FindConVar("sv_maxplayers"); - g_bIsConfoglAvailable = LibraryExists("confogl"); -} + RegConsoleCmd("sm_match", MatchRequest); + RegConsoleCmd("sm_rmatch", MatchReset); -public void OnConfigsExecuted() -{ - if (!g_bOnSet) { - g_hSvMaxPlayers.SetInt(g_hMaxPlayers.IntValue); - g_bOnSet = true; - } -} - -public void OnPluginEnd() -{ - g_hSvMaxPlayers.SetInt(g_hMaxPlayers.IntValue); + g_bIsConfoglAvailable = LibraryExists("confogl"); } public void OnLibraryRemoved(const char[] sPluginName) { - if (strcmp(sPluginName, "confogl") == 0) { - g_bIsConfoglAvailable = false; - } + if (strcmp(sPluginName, "confogl") == 0) { + g_bIsConfoglAvailable = false; + } } public void OnLibraryAdded(const char[] sPluginName) { - if (strcmp(sPluginName, "confogl") == 0) { - g_bIsConfoglAvailable = true; - } + if (strcmp(sPluginName, "confogl") == 0) { + g_bIsConfoglAvailable = true; + } } public void OnCedapugStarted() { - g_bCedaGame = true; + g_bCedaGame = true; } public void OnCedapugEnded() { - g_bCedaGame = false; + g_bCedaGame = false; } public Action MatchRequest(int iClient, int iArgs) { - if (!g_hEnabled.BoolValue || iClient == 0 || !g_bIsConfoglAvailable) { - return Plugin_Handled; - } - - if (iArgs > 0) { - //config specified - char sCfg[64], sName[64]; - GetCmdArg(1, sCfg, sizeof(sCfg)); - - if (FindConfigName(sCfg, sName, sizeof(sName))) { - if (StartMatchVote(iClient, sName)) { - strcopy(g_sCfg, sizeof(g_sCfg), sCfg); - - //caller is voting for - FakeClientCommand(iClient, "Vote Yes"); - } - - return Plugin_Handled; - } - } - - //show main menu - MatchModeMenu(iClient); - return Plugin_Handled; + if (!g_hEnabled.BoolValue || iClient == 0 || !g_bIsConfoglAvailable) { + return Plugin_Handled; + } + + if (iArgs > 0) { + //config specified + char sCfg[64], sName[64]; + GetCmdArg(1, sCfg, sizeof(sCfg)); + + if (FindConfigName(sCfg, sName, sizeof(sName))) { + if (StartMatchVote(iClient, sName)) { + strcopy(g_sCfg, sizeof(g_sCfg), sCfg); + + //caller is voting for + FakeClientCommand(iClient, "Vote Yes"); + } + + return Plugin_Handled; + } + } + + //show main menu + MatchModeMenu(iClient); + return Plugin_Handled; } bool FindConfigName(const char[] sConfig, char[] sName, const int iMaxLength) { - g_hModesKV.Rewind(); - - if (g_hModesKV.GotoFirstSubKey()) { - do { - if (g_hModesKV.JumpToKey(sConfig)) { - g_hModesKV.GetString("name", sName, iMaxLength); - return true; - } - } while (g_hModesKV.GotoNextKey(false)); - } - - return false; + g_hModesKV.Rewind(); + + if (g_hModesKV.GotoFirstSubKey()) { + do { + if (g_hModesKV.JumpToKey(sConfig)) { + g_hModesKV.GetString("name", sName, iMaxLength); + return true; + } + } while (g_hModesKV.GotoNextKey(false)); + } + + return false; } void MatchModeMenu(int iClient) { - Menu hMenu = new Menu(MatchModeMenuHandler); - hMenu.SetTitle("Select match mode:"); + Menu hMenu = new Menu(MatchModeMenuHandler); + hMenu.SetTitle("Select match mode:"); - char sBuffer[64]; - g_hModesKV.Rewind(); + char sBuffer[64]; + g_hModesKV.Rewind(); - if (g_hModesKV.GotoFirstSubKey()) { - do { - g_hModesKV.GetSectionName(sBuffer, sizeof(sBuffer)); - hMenu.AddItem(sBuffer, sBuffer); - } while (g_hModesKV.GotoNextKey(false)); - } + if (g_hModesKV.GotoFirstSubKey()) { + do { + g_hModesKV.GetSectionName(sBuffer, sizeof(sBuffer)); + hMenu.AddItem(sBuffer, sBuffer); + } while (g_hModesKV.GotoNextKey(false)); + } - hMenu.Display(iClient, 20); + hMenu.Display(iClient, 20); } public int MatchModeMenuHandler(Menu menu, MenuAction action, int param1, int param2) { - if (action == MenuAction_End) { - delete menu; - } else if (action == MenuAction_Select) { - char sInfo[64], sBuffer[64]; - menu.GetItem(param2, sInfo, sizeof(sInfo)); + if (action == MenuAction_End) { + delete menu; + } else if (action == MenuAction_Select) { + char sInfo[64], sBuffer[64]; + menu.GetItem(param2, sInfo, sizeof(sInfo)); - g_hModesKV.Rewind(); + g_hModesKV.Rewind(); - if (g_hModesKV.JumpToKey(sInfo) && g_hModesKV.GotoFirstSubKey()) { - Menu hMenu = new Menu(ConfigsMenuHandler); + if (g_hModesKV.JumpToKey(sInfo) && g_hModesKV.GotoFirstSubKey()) { + Menu hMenu = new Menu(ConfigsMenuHandler); - FormatEx(sBuffer, sizeof(sBuffer), "Select %s config:", sInfo); - hMenu.SetTitle(sBuffer); + FormatEx(sBuffer, sizeof(sBuffer), "Select %s config:", sInfo); + hMenu.SetTitle(sBuffer); - do { - g_hModesKV.GetSectionName(sInfo, sizeof(sInfo)); - g_hModesKV.GetString("name", sBuffer, sizeof(sBuffer)); + do { + g_hModesKV.GetSectionName(sInfo, sizeof(sInfo)); + g_hModesKV.GetString("name", sBuffer, sizeof(sBuffer)); - hMenu.AddItem(sInfo, sBuffer); - } while (g_hModesKV.GotoNextKey()); + hMenu.AddItem(sInfo, sBuffer); + } while (g_hModesKV.GotoNextKey()); - hMenu.Display(param1, 20); - } else { - CPrintToChat(param1, "{blue}[{default}Match{blue}] {default}No configs for such mode were found."); - MatchModeMenu(param1); - } - } + hMenu.Display(param1, 20); + } else { + CPrintToChat(param1, "{blue}[{default}Match{blue}] {default}No configs for such mode were found."); + MatchModeMenu(param1); + } + } - return 0; + return 0; } public int ConfigsMenuHandler(Menu menu, MenuAction action, int param1, int param2) { - if (action == MenuAction_End) { - delete menu; - } else if (action == MenuAction_Cancel) { - MatchModeMenu(param1); - } else if (action == MenuAction_Select) { - char sInfo[64], sBuffer[64]; - menu.GetItem(param2, sInfo, sizeof(sInfo), _, sBuffer, sizeof(sBuffer)); - - if (StartMatchVote(param1, sBuffer)) { - strcopy(g_sCfg, sizeof(g_sCfg), sInfo); - //caller is voting for - FakeClientCommand(param1, "Vote Yes"); - } else { - MatchModeMenu(param1); - } - } - - return 0; + if (action == MenuAction_End) { + delete menu; + } else if (action == MenuAction_Cancel) { + MatchModeMenu(param1); + } else if (action == MenuAction_Select) { + char sInfo[64], sBuffer[64]; + menu.GetItem(param2, sInfo, sizeof(sInfo), _, sBuffer, sizeof(sBuffer)); + + if (StartMatchVote(param1, sBuffer)) { + strcopy(g_sCfg, sizeof(g_sCfg), sInfo); + //caller is voting for + FakeClientCommand(param1, "Vote Yes"); + } else { + MatchModeMenu(param1); + } + } + + return 0; } bool StartMatchVote(int iClient, const char[] sCfgName) { - if (GetClientTeam(iClient) <= TEAM_SPECTATE) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match voting isn't allowed for spectators."); - return false; - } - - if (LGO_IsMatchModeLoaded()) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Matchmode already loaded!"); - return false; - } - - if (!IsBuiltinVoteInProgress()) { - int iNumPlayers = 0; - int[] iPlayers = new int[MaxClients]; - - //list of non-spectators players - for (int i = 1; i <= MaxClients; i++) { - if (!IsClientInGame(i) || IsFakeClient(i) || GetClientTeam(i) <= TEAM_SPECTATE) { - continue; - } - - iPlayers[iNumPlayers++] = i; - } - - if (iNumPlayers < g_hCvarPlayerLimit.IntValue) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match vote cannot be started. Not enough players."); - return false; - } - - char sBuffer[64]; - FormatEx(sBuffer, sizeof(sBuffer), "Load confogl '%s' config?", sCfgName); - - g_hVote = CreateBuiltinVote(VoteActionHandler, BuiltinVoteType_Custom_YesNo, BuiltinVoteAction_Cancel | BuiltinVoteAction_VoteEnd | BuiltinVoteAction_End); - SetBuiltinVoteArgument(g_hVote, sBuffer); - SetBuiltinVoteInitiator(g_hVote, iClient); - SetBuiltinVoteResultCallback(g_hVote, MatchVoteResultHandler); - DisplayBuiltinVote(g_hVote, iPlayers, iNumPlayers, 20); - - return true; - } - - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match vote cannot be started now."); - return false; + if (GetClientTeam(iClient) <= TEAM_SPECTATE) { + CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match voting isn't allowed for spectators."); + return false; + } + + if (!IsBuiltinVoteInProgress()) { + int iNumPlayers = 0; + int[] iPlayers = new int[MaxClients]; + + //list of non-spectators players + for (int i = 1; i <= MaxClients; i++) { + if (!IsClientInGame(i) || IsFakeClient(i) || GetClientTeam(i) <= TEAM_SPECTATE) { + continue; + } + + iPlayers[iNumPlayers++] = i; + } + + if (iNumPlayers < g_hCvarPlayerLimit.IntValue) { + CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match vote cannot be started. Not enough players."); + return false; + } + + char sBuffer[64]; + FormatEx(sBuffer, sizeof(sBuffer), "Load confogl '%s' config?", sCfgName); + + g_hVote = CreateBuiltinVote(VoteActionHandler, BuiltinVoteType_Custom_YesNo, BuiltinVoteAction_Cancel | BuiltinVoteAction_VoteEnd | BuiltinVoteAction_End); + SetBuiltinVoteArgument(g_hVote, sBuffer); + SetBuiltinVoteInitiator(g_hVote, iClient); + SetBuiltinVoteResultCallback(g_hVote, MatchVoteResultHandler); + DisplayBuiltinVote(g_hVote, iPlayers, iNumPlayers, 20); + + return true; + } + + CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match vote cannot be started now."); + return false; } public void VoteActionHandler(Handle vote, BuiltinVoteAction action, int param1, int param2) { - switch (action) { - case BuiltinVoteAction_End: { - delete vote; - g_hVote = null; - } - case BuiltinVoteAction_Cancel: { - DisplayBuiltinVoteFail(vote, view_as(param1)); - } - } + switch (action) { + case BuiltinVoteAction_End: { + delete vote; + g_hVote = null; + } + case BuiltinVoteAction_Cancel: { + DisplayBuiltinVoteFail(vote, view_as(param1)); + } + } } public void MatchVoteResultHandler(Handle vote, int num_votes, int num_clients, \ - const int[][] client_info, int num_items, const int[][] item_info) + const int[][] client_info, int num_items, const int[][] item_info) { - for (int i = 0; i < num_items; i++) { - if (item_info[i][BUILTINVOTEINFO_ITEM_INDEX] == BUILTINVOTES_VOTE_YES) { - if (item_info[i][BUILTINVOTEINFO_ITEM_VOTES] > (num_votes / 2)) { - DisplayBuiltinVotePass(vote, "Matchmode Loaded"); - ServerCommand("sm_forcematch %s", g_sCfg); - - return; - } - } - } - - DisplayBuiltinVoteFail(vote, BuiltinVoteFail_Loses); + for (int i = 0; i < num_items; i++) { + if (item_info[i][BUILTINVOTEINFO_ITEM_INDEX] == BUILTINVOTES_VOTE_YES) { + if (item_info[i][BUILTINVOTEINFO_ITEM_VOTES] > (num_votes / 2)) { + DisplayBuiltinVotePass(vote, "Matchmode Loaded"); + ServerCommand("sm_forcematch %s", g_sCfg); + + return; + } + } + } + + DisplayBuiltinVoteFail(vote, BuiltinVoteFail_Loses); } public Action MatchReset(int iClient, int iArgs) { - if (!g_hEnabled.BoolValue || iClient == 0 || !g_bIsConfoglAvailable) { - return Plugin_Handled; - } + if (!g_hEnabled.BoolValue || iClient == 0 || !g_bIsConfoglAvailable) { + return Plugin_Handled; + } - if (g_bCedaGame) { - return Plugin_Handled; - } + if (g_bCedaGame) { + return Plugin_Handled; + } - //voting for resetmatch - StartResetMatchVote(iClient); - return Plugin_Handled; + //voting for resetmatch + StartResetMatchVote(iClient); + return Plugin_Handled; } bool StartResetMatchVote(int iClient) { - if (GetClientTeam(iClient) <= TEAM_SPECTATE) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Resetmatch voting isn't allowed for spectators."); - return false; - } - - if (!LGO_IsMatchModeLoaded()) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}No matchmode loaded."); - return false; - } - - if (IsNewBuiltinVoteAllowed()) { - int iNumPlayers = 0, iConnectedCount = 0; - int[] iPlayers = new int[MaxClients]; - - for (int i = 1; i <= MaxClients; i++) { - if (!IsClientInGame(i)) { - if (IsClientConnected(i)) { - iConnectedCount++; - } - } else { - if (!IsFakeClient(i) && GetClientTeam(i) > TEAM_SPECTATE) { - iPlayers[iNumPlayers++] = i; - } - } - } - - if (iConnectedCount > 0) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Resetmatch vote cannot be started. Players are connecting"); - return false; - } - - g_hVote = CreateBuiltinVote(VoteActionHandler, BuiltinVoteType_Custom_YesNo, BuiltinVoteAction_Cancel | BuiltinVoteAction_VoteEnd | BuiltinVoteAction_End); - SetBuiltinVoteArgument(g_hVote, "Turn off confogl?"); - SetBuiltinVoteInitiator(g_hVote, iClient); - SetBuiltinVoteResultCallback(g_hVote, ResetMatchVoteResultHandler); - DisplayBuiltinVote(g_hVote, iPlayers, iNumPlayers, 20); - - FakeClientCommand(iClient, "Vote Yes"); - return true; - } - - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Resetmatch vote cannot be started now."); - return false; + if (GetClientTeam(iClient) <= TEAM_SPECTATE) { + CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Resetmatch voting isn't allowed for spectators."); + return false; + } + + if (!LGO_IsMatchModeLoaded()) { + CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}No matchmode loaded."); + return false; + } + + if (IsNewBuiltinVoteAllowed()) { + int iNumPlayers = 0, iConnectedCount = 0; + int[] iPlayers = new int[MaxClients]; + + for (int i = 1; i <= MaxClients; i++) { + if (!IsClientInGame(i)) { + if (IsClientConnected(i)) { + iConnectedCount++; + } + } else { + if (!IsFakeClient(i) && GetClientTeam(i) > TEAM_SPECTATE) { + iPlayers[iNumPlayers++] = i; + } + } + } + + if (iConnectedCount > 0) { + CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Resetmatch vote cannot be started. Players are connecting"); + return false; + } + + g_hVote = CreateBuiltinVote(VoteActionHandler, BuiltinVoteType_Custom_YesNo, BuiltinVoteAction_Cancel | BuiltinVoteAction_VoteEnd | BuiltinVoteAction_End); + SetBuiltinVoteArgument(g_hVote, "Turn off confogl?"); + SetBuiltinVoteInitiator(g_hVote, iClient); + SetBuiltinVoteResultCallback(g_hVote, ResetMatchVoteResultHandler); + DisplayBuiltinVote(g_hVote, iPlayers, iNumPlayers, 20); + + FakeClientCommand(iClient, "Vote Yes"); + return true; + } + + CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Resetmatch vote cannot be started now."); + return false; } public void ResetMatchVoteResultHandler(Handle vote, int num_votes, int num_clients, \ - const int[][] client_info, int num_items, const int[][] item_info) -{ - for (int i = 0; i < num_items; i++) { - if (item_info[i][BUILTINVOTEINFO_ITEM_INDEX] == BUILTINVOTES_VOTE_YES) { - if (item_info[i][BUILTINVOTEINFO_ITEM_VOTES] > (num_votes / 2)) { - DisplayBuiltinVotePass(vote, "Confogl is unloading..."); - ServerCommand("sm_resetmatch"); - - return; - } - } - } - - DisplayBuiltinVoteFail(vote, BuiltinVoteFail_Loses); -} - -public Action ChangeMatchRequest(int iClient, int iArgs) -{ - if (!g_hEnabled.BoolValue || iClient == 0 || !g_bIsConfoglAvailable) { - return Plugin_Handled; - } - - if (iArgs > 0) { - //config specified - char sCfg[64], sName[64]; - GetCmdArg(1, sCfg, sizeof(sCfg)); - if (FindConfigName(sCfg, sName, sizeof(sName))) { - if (StartChMatchVote(iClient, sName)) { - strcopy(g_sCfg, sizeof(g_sCfg), sCfg); - - //caller is voting for - FakeClientCommand(iClient, "Vote Yes"); - } - return Plugin_Handled; - } - } - - //show main menu - ChMatchModeMenu(iClient); - return Plugin_Handled; -} - -void ChMatchModeMenu(int iClient) -{ - Menu hMenu = new Menu(ChMatchModeMenuHandler); - hMenu.SetTitle("Select match mode:"); - - char sBuffer[64]; - g_hModesKV.Rewind(); - - if (g_hModesKV.GotoFirstSubKey()) { - do { - g_hModesKV.GetSectionName(sBuffer, sizeof(sBuffer)); - hMenu.AddItem(sBuffer, sBuffer); - } while (g_hModesKV.GotoNextKey(false)); - } - - hMenu.Display(iClient, 20); -} - -public int ChMatchModeMenuHandler(Menu menu, MenuAction action, int param1, int param2) -{ - if (action == MenuAction_End) { - delete menu; - } else if (action == MenuAction_Select) { - char sInfo[64], sBuffer[64]; - menu.GetItem(param2, sInfo, sizeof(sInfo)); - - g_hModesKV.Rewind(); - - if (g_hModesKV.JumpToKey(sInfo) && g_hModesKV.GotoFirstSubKey()) { - Menu hMenu = new Menu(ChConfigsMenuHandler); - - FormatEx(sBuffer, sizeof(sBuffer), "Select %s config:", sInfo); - hMenu.SetTitle(sBuffer); - - do { - g_hModesKV.GetSectionName(sInfo, sizeof(sInfo)); - g_hModesKV.GetString("name", sBuffer, sizeof(sBuffer)); - - hMenu.AddItem(sInfo, sBuffer); - } while (g_hModesKV.GotoNextKey()); - - hMenu.Display(param1, 20); - } else { - CPrintToChat(param1, "{blue}[{default}Match{blue}] {default}No configs for such mode were found."); - ChMatchModeMenu(param1); - } - } - - return 0; -} - -public int ChConfigsMenuHandler(Menu menu, MenuAction action, int param1, int param2) -{ - if (action == MenuAction_End) { - delete menu; - } else if (action == MenuAction_Cancel) { - ChMatchModeMenu(param1); - } else if (action == MenuAction_Select) { - char sInfo[64], sBuffer[64]; - menu.GetItem(param2, sInfo, sizeof(sInfo), _, sBuffer, sizeof(sBuffer)); - - if (StartChMatchVote(param1, sBuffer)) { - strcopy(g_sCfg, sizeof(g_sCfg), sInfo); - //caller is voting for - FakeClientCommand(param1, "Vote Yes"); - } else { - ChMatchModeMenu(param1); - } - } - - return 0; -} - -bool StartChMatchVote(int iClient, const char[] sCfgName) -{ - if (GetClientTeam(iClient) <= TEAM_SPECTATE) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match voting isn't allowed for spectators."); - return false; - } - - if (!LGO_IsMatchModeLoaded()) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Matchmode isn't already loaded! Use !match instead!"); - return false; - } - - if (IsNewBuiltinVoteAllowed() || !IsBuiltinVoteInProgress()) { - int iNumPlayers = 0, iConnectedCount = 0; - int[] iPlayers = new int[MaxClients]; - - //list of non-spectators players - for (int i = 1; i <= MaxClients; i++) { - if (!IsClientInGame(i) || IsFakeClient(i) || GetClientTeam(i) <= TEAM_SPECTATE) { - continue; - } - - iPlayers[iNumPlayers++] = i; - } - - if (iNumPlayers < g_hCvarPlayerLimit.IntValue) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match vote cannot be started. Not enough players."); - return false; - } - - if (iConnectedCount > 0) { - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Changematch vote cannot be started. Players are connecting"); - return false; - } - - char sBuffer[64]; - FormatEx(sBuffer, sizeof(sBuffer), "Change confogl config to '%s'?", sCfgName); - - g_hVote = CreateBuiltinVote(VoteActionHandler, BuiltinVoteType_Custom_YesNo, BuiltinVoteAction_Cancel | BuiltinVoteAction_VoteEnd | BuiltinVoteAction_End); - SetBuiltinVoteArgument(g_hVote, sBuffer); - SetBuiltinVoteInitiator(g_hVote, iClient); - SetBuiltinVoteResultCallback(g_hVote, ChMatchVoteResultHandler); - DisplayBuiltinVote(g_hVote, iPlayers, iNumPlayers, 20); - - return true; - } - - CPrintToChat(iClient, "{blue}[{default}Match{blue}] {default}Match vote cannot be started now."); - return false; -} - -public void ChMatchVoteResultHandler(Handle vote, int num_votes, int num_clients, \ - const int[][] client_info, int num_items, const int[][] item_info) + const int[][] client_info, int num_items, const int[][] item_info) { - for (int i = 0; i < num_items; i++) { - if (item_info[i][BUILTINVOTEINFO_ITEM_INDEX] == BUILTINVOTES_VOTE_YES) { - if (item_info[i][BUILTINVOTEINFO_ITEM_VOTES] > (num_votes / 2)) { - DisplayBuiltinVotePass(vote, "Matchmode Changed"); - ServerCommand("sm_forcechangematch %s", g_sCfg); - - return; - } - } - } - - DisplayBuiltinVoteFail(vote, BuiltinVoteFail_Loses); + for (int i = 0; i < num_items; i++) { + if (item_info[i][BUILTINVOTEINFO_ITEM_INDEX] == BUILTINVOTES_VOTE_YES) { + if (item_info[i][BUILTINVOTEINFO_ITEM_VOTES] > (num_votes / 2)) { + DisplayBuiltinVotePass(vote, "Confogl is unloading..."); + ServerCommand("sm_resetmatch"); + + return; + } + } + } + + DisplayBuiltinVoteFail(vote, BuiltinVoteFail_Loses); } \ No newline at end of file diff --git a/addons/sourcemod/scripting/plugin_unload_protect.sp b/addons/sourcemod/scripting/plugin_unload_protect.sp new file mode 100644 index 000000000..b5aff6d74 --- /dev/null +++ b/addons/sourcemod/scripting/plugin_unload_protect.sp @@ -0,0 +1,352 @@ +#pragma semicolon 1 +#pragma newdecls required + +#include + +#define DATA_FILE_PATH "data/protected_plugins_list.txt" + +#define PL_NONE 0 +#define PL_UNLOCK (1 << 0) +#define PL_UNLOAD (1 << 1) +#define PL_REFRESH (1 << 2) +#define PL_LOAD (1 << 3) +#define PL_LOCK (1 << 4) + +int g_iActions = PL_NONE; +bool g_bNextFrameQueued; +bool g_bUnloadQueued; + +ArrayList g_alProtectedPlugins; +ArrayList g_alPluginUnloadQueue; +ArrayList g_alPluginLoadQueue; + +public Plugin myinfo = { + name = "Plugin Unload Protect", + author = "0x0c", + description = "Wrapper around sm plugins to prevent certain plugins from being unloaded", + version = "1.1.0", + url = "https://solaris-servers.ru/" +} + +public void OnPluginStart() { + g_alProtectedPlugins = new ArrayList(PLATFORM_MAX_PATH); + g_alPluginLoadQueue = new ArrayList(PLATFORM_MAX_PATH); + g_alPluginUnloadQueue = new ArrayList(PLATFORM_MAX_PATH); + + RegAdminCmd("sm_plugins_protect", Cmd_Protect, ADMFLAG_RCON); + RegAdminCmd("sm_plugins_unprotect", Cmd_Unprotect, ADMFLAG_RCON); + RegAdminCmd("sm_plugins_protect_list", Cmd_List, ADMFLAG_RCON); + RegAdminCmd("sm_plugins_load_lock", Cmd_LoadLock, ADMFLAG_RCON); + RegAdminCmd("sm_plugins_load_unlock", Cmd_LoadUnlock, ADMFLAG_RCON); + RegAdminCmd("sm_plugins_refresh", Cmd_Refresh, ADMFLAG_RCON); + RegAdminCmd("sm_plugins_load", Cmd_Load, ADMFLAG_RCON); + RegAdminCmd("sm_plugins_unload", Cmd_Unload, ADMFLAG_RCON); + RegAdminCmd("sm_plugins_unload_all", Cmd_UnloadAll, ADMFLAG_RCON); + + ReadOrCreateDataFile(); +} + +public void OnAllPluginsLoaded() { + char szFilename[PLATFORM_MAX_PATH]; + Handle hPlugin = null; + Handle hIterator = GetPluginIterator(); + + while (MorePlugins(hIterator)) { + hPlugin = ReadPlugin(hIterator); + GetPluginFilename(hPlugin, szFilename, sizeof(szFilename)); + // add self to protected list + if (IsDefaultProtected(szFilename) && !IsPluginProtected(szFilename)) { + g_alProtectedPlugins.PushString(szFilename); + } + } + delete hIterator; +} + +void ReadOrCreateDataFile() { + char szDataPath[PLATFORM_MAX_PATH]; + BuildPath(Path_SM, szDataPath, sizeof(szDataPath), "%s", DATA_FILE_PATH); + File file; + + if (!FileExists(szDataPath)) { + // file does not existt, simply create it and bail + file = OpenFile(szDataPath, "w"); + delete file; + return; + } + + char szLine[PLATFORM_MAX_PATH]; + file = OpenFile(szDataPath, "r"); + + while (!file.EndOfFile()) { + file.ReadLine(szLine, PLATFORM_MAX_PATH); + NormalizePluginFileName(szLine); + ServerCommand("sm_plugins_protect %s", szLine); + } + + delete file; +} + +Action Cmd_Protect(int iClient, int iArgs) { + if (iArgs < 1) { + ReplyToCommand(iClient, "Usage: sm_protect "); + return Plugin_Handled; + } + + char szFilename[PLATFORM_MAX_PATH]; + GetCmdArg(1, szFilename, sizeof(szFilename)); + NormalizePluginFileName(szFilename); + // check for duplicates + if (IsPluginProtected(szFilename)) { + ReplyToCommand(iClient, "[PluginUnloadProtect] %s is already protected", szFilename); + return Plugin_Handled; + } + // check that such a file exists + char szFullPath[PLATFORM_MAX_PATH]; + BuildPath(Path_SM, szFullPath, sizeof(szFullPath), "plugins/%s", szFilename); + if (!FileExists(szFullPath)) { + LogError("[PluginUnloadProtect] File %s does not exist", szFullPath); + return Plugin_Handled; + } + + g_alProtectedPlugins.PushString(szFilename); + + return Plugin_Handled; +} + +Action Cmd_Unprotect(int iClient, int iArgs) { + if (iArgs < 1) { + ReplyToCommand(iClient, "Usage: sm_unprotect "); + return Plugin_Handled; + } + + char szFilename[PLATFORM_MAX_PATH]; + GetCmdArg(1, szFilename, sizeof(szFilename)); + NormalizePluginFileName(szFilename); + + if (IsDefaultProtected(szFilename)) { + ReplyToCommand(iClient, "[PluginUnloadProtect] Can not unprotect default plugin"); + return Plugin_Handled; + } + + int iItem = g_alProtectedPlugins.FindString(szFilename); + if (iItem == -1) { + ReplyToCommand(iClient, "[PluginUnloadProtect] %s is not protected", szFilename); + return Plugin_Handled; + } + g_alProtectedPlugins.Erase(iItem); + + return Plugin_Handled; +} + +Action Cmd_List(int iClient, int iArgs) { + ReplyToCommand(iClient, "[PluginUnloadProtect] List of protected plugins (%i):", g_alProtectedPlugins.Length); + char szFilename[PLATFORM_MAX_PATH]; + for (int i = 0; i < g_alProtectedPlugins.Length; i++) { + g_alProtectedPlugins.GetString(i, szFilename, sizeof(szFilename)); + ReplyToCommand(iClient, "- %s", szFilename); + } + + return Plugin_Handled; +} + +Action Cmd_LoadLock(int iClient, int iArgs) { + g_iActions |= PL_LOCK; + ScheduleActions(); + return Plugin_Handled; +} + +Action Cmd_LoadUnlock(int iClient, int iArgs) { + g_iActions |= PL_UNLOCK; + ScheduleActions(); + return Plugin_Handled; +} + +Action Cmd_Refresh(int iClient, int iArgs) { + g_iActions |= PL_REFRESH; + ScheduleActions(); + return Plugin_Handled; +} + +Action Cmd_Load(int iClient, int iArgs) { + if (iArgs < 1) { + ReplyToCommand(iClient, "Usage: sm_plugins_load "); + return Plugin_Handled; + } + + char szFilename[PLATFORM_MAX_PATH]; + GetCmdArg(1, szFilename, sizeof(szFilename)); + NormalizePluginFileName(szFilename); + g_alPluginLoadQueue.PushString(szFilename); + g_iActions |= PL_LOAD; + ScheduleActions(); + + return Plugin_Handled; +} + +Action Cmd_Unload(int iClient, int iArgs) { + if (iArgs < 1) { + ReplyToCommand(iClient, "Usage: sm_plugins_unload "); + return Plugin_Handled; + } + + char szFilename[PLATFORM_MAX_PATH]; + GetCmdArg(1, szFilename, sizeof(szFilename)); + NormalizePluginFileName(szFilename); + + if (IsPluginProtected(szFilename)) { + ReplyToCommand(iClient, "[PluginUnloadProtect] Plugin %s can not be unloaded, because it is currently protected", szFilename); + return Plugin_Handled; + } + + g_alPluginUnloadQueue.PushString(szFilename); + g_iActions |= PL_UNLOAD; + ScheduleActions(); + + return Plugin_Handled; +} + +Action Cmd_UnloadAll(int iClient, int iArgs) { + if (g_alPluginUnloadQueue.Length > 0) { + ReplyToCommand(iClient, "[PluginUnloadProtect] Could not execute the command, plugins are currently being unloaded"); + return Plugin_Handled; + } + + char szFilename[PLATFORM_MAX_PATH]; + Handle hPlugin = null; + Handle hIterator = GetPluginIterator(); + + while (MorePlugins(hIterator)) { + hPlugin = ReadPlugin(hIterator); + GetPluginFilename(hPlugin, szFilename, sizeof(szFilename)); + if (IsPluginProtected(szFilename)) + continue; + + g_alPluginUnloadQueue.PushString(szFilename); + } + + delete hIterator; + g_iActions |= PL_UNLOAD; + ScheduleActions(); + + return Plugin_Handled; +} + +void ScheduleActions() { + if (g_bNextFrameQueued) + return; + + g_bNextFrameQueued = true; + RequestFrame(ScheduleActions_NextFrame); +} + +void ScheduleActions_NextFrame() { + if (g_iActions == PL_NONE) { + g_bNextFrameQueued = false; + return; + } + + if (g_iActions & PL_UNLOCK == PL_UNLOCK) { + ServerCommand("sm plugins load_unlock"); + g_iActions &= ~PL_UNLOCK; + } else if (g_iActions & PL_UNLOAD == PL_UNLOAD) { + if (g_bUnloadQueued) { + AwaitUnload(); + } else { + ExecuteUnload(); + } + } else if (g_iActions & PL_REFRESH == PL_REFRESH) { + ServerCommand("sm plugins refresh"); + g_iActions &= ~PL_REFRESH; + } else if (g_iActions & PL_LOAD == PL_LOAD) { + ExecuteLoad(); + g_iActions &= ~PL_LOAD; + } else if (g_iActions & PL_LOCK == PL_LOCK) { + ServerCommand("sm plugins load_lock"); + g_iActions &= ~PL_LOCK; + } else { + g_iActions = PL_NONE; + } + + RequestFrame(ScheduleActions_NextFrame); +} + +void ExecuteUnload() { + char szFilename[PLATFORM_MAX_PATH]; + + for (int i = g_alPluginUnloadQueue.Length - 1; i >= 0; i--) { + g_alPluginUnloadQueue.GetString(i, szFilename, sizeof(szFilename)); + ServerCommand("sm plugins unload %s", szFilename); + } + + g_bUnloadQueued = true; +} + +void AwaitUnload() { + char szFilename[PLATFORM_MAX_PATH]; + + for (int i = g_alPluginUnloadQueue.Length - 1; i >= 0; i--) { + Handle hPlugin = null; + Handle hIterator = GetPluginIterator(); + + while (MorePlugins(hIterator)) { + hPlugin = ReadPlugin(hIterator); + GetPluginFilename(hPlugin, szFilename, sizeof(szFilename)); + g_bUnloadQueued = g_alPluginUnloadQueue.FindString(szFilename) > -1; + if (g_bUnloadQueued) { + break; + } + } + + delete hIterator; + if (g_bUnloadQueued) { + break; + } + } + + if (!g_bUnloadQueued) { + g_alPluginUnloadQueue.Clear(); + g_iActions &= ~PL_UNLOAD; + } +} + +void ExecuteLoad() { + char szFilename[PLATFORM_MAX_PATH]; + for (int i = 0; i < g_alPluginLoadQueue.Length; i++) { + g_alPluginLoadQueue.GetString(i, szFilename, sizeof(szFilename)); + ServerCommand("sm plugins load %s", szFilename); + } + + g_alPluginLoadQueue.Clear(); +} + +bool IsPluginProtected(const char[] szFilename) { + return g_alProtectedPlugins.FindString(szFilename) > -1; +} + +void NormalizePluginFileName(char[] szFilename) { + TrimString(szFilename); + if (StrContains(szFilename, ".smx", true) == -1) { + StrCat(szFilename, PLATFORM_MAX_PATH, ".smx"); + } +} + +bool IsDefaultProtected(const char[] szFilename) { + static const char szProtectedDefault[][PLATFORM_MAX_PATH] = { + "plugin_unload_protect" + }; + + char szFilenameWithoutExt[PLATFORM_MAX_PATH]; + strcopy(szFilenameWithoutExt, sizeof(szFilenameWithoutExt), szFilename); + ReplaceString(szFilenameWithoutExt, sizeof(szFilenameWithoutExt), ".smx", "", false); + + char szDefaultPluginWithoutExt[PLATFORM_MAX_PATH]; + for (int i = 0; i < sizeof(szProtectedDefault); i++) { + strcopy(szDefaultPluginWithoutExt, sizeof(szDefaultPluginWithoutExt), szProtectedDefault[i]); + ReplaceString(szDefaultPluginWithoutExt, sizeof(szDefaultPluginWithoutExt), ".smx", "", false); + if (strcmp(szFilenameWithoutExt, szDefaultPluginWithoutExt, false) == 0) { + return true; + } + } + + return false; +} \ No newline at end of file diff --git a/addons/sourcemod/scripting/slots_vote.sp b/addons/sourcemod/scripting/slots_vote.sp index 846393e2d..d1e09b963 100644 --- a/addons/sourcemod/scripting/slots_vote.sp +++ b/addons/sourcemod/scripting/slots_vote.sp @@ -5,6 +5,9 @@ #include #include +#undef REQUIRE_PLUGIN +#include + #define L4D2Team_Spectator 1 Handle g_hVote; @@ -12,145 +15,182 @@ char g_sSlots[32]; ConVar hMaxSlots; int MaxSlots; +ConVar L4DToolz_MaxPlayers; +ConVar L4DToolz_VisibleMaxPlayers; +ConVar g_hMaxPlayers; + +ConVar g_cvSurvivorLimit; +ConVar g_cvInfectedLimit; + public Plugin myinfo = { - name = "Slots?! Voter", - description = "Slots Voter", - author = "Sir", - version = "", - url = "https://github.com/SirPlease/L4D2-Competitive-Rework/" + name = "Slots?! Voter", + description = "Slots Voter", + author = "Sir", + version = "", + url = "https://github.com/SirPlease/L4D2-Competitive-Rework/" }; public void OnPluginStart() { - LoadTranslations("slots_vote.phrases"); - RegConsoleCmd("sm_slots", SlotsRequest); - hMaxSlots = CreateConVar("slots_max_slots", "30", "Maximum amount of slots you wish players to be able to vote for? (DON'T GO HIGHER THAN 30)"); - MaxSlots = hMaxSlots.IntValue; - HookConVarChange(hMaxSlots, CVarChanged); + LoadTranslations("slots_vote.phrases"); + RegConsoleCmd("sm_slots", SlotsRequest); + + g_cvSurvivorLimit = FindConVar("survivor_limit"); + g_cvInfectedLimit = FindConVar("z_max_player_zombies"); + + hMaxSlots = CreateConVar("slots_max_slots", "30", "Maximum amount of slots you wish players to be able to vote for? (DON'T GO HIGHER THAN 30)", _, true, 1.0, true, 30.0); // we just prevent going higher with minimum/maximum values + MaxSlots = hMaxSlots.IntValue; + hMaxSlots.AddChangeHook(CvChg_MaxSlotsChanged); + + L4DToolz_MaxPlayers = FindConVar("sv_maxplayers"); + L4DToolz_VisibleMaxPlayers = FindConVar("sv_visiblemaxplayers"); + + g_hMaxPlayers = CreateConVar("mv_maxplayers", "-1", "How many slots would you like the Server to be at Config Load/Unload? (DON'T GO HIGHER THAN 30)", _, true, 1.0, true, 30.0); // we just prevent going higher with minimum/maximum values + g_hMaxPlayers.IntValue = L4DToolz_MaxPlayers.IntValue; + + L4DToolz_MaxPlayers.AddChangeHook(CvChg_MaxPlayersChanged); + L4DToolz_VisibleMaxPlayers.AddChangeHook(CvChg_MaxPlayersChanged); + g_hMaxPlayers.AddChangeHook(CvChg_MaxPlayersChanged); } public Action SlotsRequest(int client, int args) { - if (client == 0) - { - ReplyToCommand(client, "%T", "NotConsoleVote", LANG_SERVER); - return Plugin_Handled; - } - - if (args == 1) - { - char sSlots[64]; - GetCmdArg(1, sSlots, sizeof(sSlots)); - int Int = StringToInt(sSlots); - if (Int > MaxSlots) - { - CPrintToChat(client, "%t %t", "Tag", "LimitSlotsAbove", MaxSlots); - } - else - { - if (GetUserFlagBits(client) & ADMFLAG_GENERIC) - { - char sName[MAX_NAME_LENGTH]; - GetClientName(client, sName, sizeof(sName)); - CPrintToChatAll("%t %t", "Tag", "LimitedSlotsTo", sName, Int); - SetConVarInt(FindConVar("sv_maxplayers"), Int); - } - else if (Int < GetConVarInt(FindConVar("survivor_limit")) + GetConVarInt(FindConVar("z_max_player_zombies"))) - { - CPrintToChat(client, "%t %t", "Tag", "RequiredPlayers"); - } - else if (StartSlotVote(client, sSlots)) - { - strcopy(g_sSlots, sizeof(g_sSlots), sSlots); - FakeClientCommand(client, "Vote Yes"); - } - } - } - else - { - CPrintToChat(client, "%t %t", "Tag", "SlotsUsage"); - } - return Plugin_Handled; + if (client == 0) + { + ReplyToCommand(client, "%T", "NotConsoleVote", LANG_SERVER); + return Plugin_Handled; + } + + if (args == 0) + { + CPrintToChat(client, "%t %t", "Tag", "SlotsUsage"); + return Plugin_Handled; + } + + char sSlots[64]; + GetCmdArg(1, sSlots, sizeof(sSlots)); + int Int = StringToInt(sSlots); + if (Int > MaxSlots) + { + CPrintToChat(client, "%t %t", "Tag", "LimitSlotsAbove", MaxSlots); + } + else + { + if (GetUserFlagBits(client) & ADMFLAG_GENERIC) + { + char sName[MAX_NAME_LENGTH]; + GetClientName(client, sName, sizeof(sName)); + CPrintToChatAll("%t %t", "Tag", "LimitedSlotsTo", sName, Int); + g_hMaxPlayers.IntValue = Int; + } + else if (Int < (g_cvSurvivorLimit.IntValue + g_cvInfectedLimit.IntValue)) + { + CPrintToChat(client, "%t %t", "Tag", "RequiredPlayers"); + } + else if (StartSlotVote(client, sSlots)) + { + strcopy(g_sSlots, sizeof(g_sSlots), sSlots); + FakeClientCommand(client, "Vote Yes"); + } + } + + return Plugin_Handled; } bool StartSlotVote(int client, char[] Slots) { - if (GetClientTeam(client) <= L4D2Team_Spectator) - { - CPrintToChat(client, "%t %t", "Tag", "Spectators"); - return false; - } - - if (!IsBuiltinVoteInProgress()) - { - int iNumPlayers = 0; - int[] iPlayers = new int[MaxClients]; - - // list of non-spectators players - for (int i = 1; i <= MaxClients; i++) - { - if (!IsClientInGame(i) || IsFakeClient(i) || GetClientTeam(i) <= L4D2Team_Spectator) - { - continue; - } - - iPlayers[iNumPlayers++] = i; - } - - char sBuffer[64]; - Format(sBuffer, sizeof(sBuffer), "%T", "LimitSlots", LANG_SERVER, Slots); - - g_hVote = CreateBuiltinVote(VoteActionHandler, BuiltinVoteType_Custom_YesNo, BuiltinVoteAction_Cancel | BuiltinVoteAction_VoteEnd | BuiltinVoteAction_End); - SetBuiltinVoteArgument(g_hVote, sBuffer); - SetBuiltinVoteInitiator(g_hVote, client); - SetBuiltinVoteResultCallback(g_hVote, SlotVoteResultHandler); - DisplayBuiltinVote(g_hVote, iPlayers, iNumPlayers, 20); - return true; - } - - CPrintToChat(client, "%t %t", "Tag", "CannotBeStarted"); - return false; + if (GetClientTeam(client) <= L4D2Team_Spectator) + { + CPrintToChat(client, "%t %t", "Tag", "Spectators"); + return false; + } + + if (!IsBuiltinVoteInProgress()) + { + int iNumPlayers = 0; + int[] iPlayers = new int[MaxClients]; + + // list of non-spectators players + for (int i = 1; i <= MaxClients; i++) + { + if (!IsClientInGame(i) || IsFakeClient(i) || GetClientTeam(i) <= L4D2Team_Spectator) + { + continue; + } + + iPlayers[iNumPlayers++] = i; + } + + char sBuffer[64]; + Format(sBuffer, sizeof(sBuffer), "%T", "LimitSlots", LANG_SERVER, Slots); + + g_hVote = CreateBuiltinVote(VoteActionHandler, BuiltinVoteType_Custom_YesNo, BuiltinVoteAction_Cancel | BuiltinVoteAction_VoteEnd | BuiltinVoteAction_End); + SetBuiltinVoteArgument(g_hVote, sBuffer); + SetBuiltinVoteInitiator(g_hVote, client); + SetBuiltinVoteResultCallback(g_hVote, SlotVoteResultHandler); + DisplayBuiltinVote(g_hVote, iPlayers, iNumPlayers, 20); + return true; + } + + CPrintToChat(client, "%t %t", "Tag", "CannotBeStarted"); + return false; } public void VoteActionHandler(Handle vote, BuiltinVoteAction action, int param1, int param2) { - switch (action) - { - case BuiltinVoteAction_End: - { - delete vote; - g_hVote = null; - } - case BuiltinVoteAction_Cancel: - { - DisplayBuiltinVoteFail(vote, view_as(param1)); - } - } + switch (action) + { + case BuiltinVoteAction_End: + { + delete vote; + g_hVote = null; + } + case BuiltinVoteAction_Cancel: + { + DisplayBuiltinVoteFail(vote, view_as(param1)); + } + } } public void SlotVoteResultHandler(Handle vote, int num_votes, int num_clients, const int[][] client_info, int num_items, const int[][] item_info) { - for (int i = 0; i < num_items; i++) - { - if (item_info[i][BUILTINVOTEINFO_ITEM_INDEX] == BUILTINVOTES_VOTE_YES) - { - if (item_info[i][BUILTINVOTEINFO_ITEM_VOTES] > (num_votes / 2)) - { - - int Slots = StringToInt(g_sSlots, 10); - char Buffer[32]; - Format(Buffer, sizeof(Buffer), "%T", "LimitingSlots", LANG_SERVER); - DisplayBuiltinVotePass(vote, Buffer); - SetConVarInt(FindConVar("sv_maxplayers"), Slots); - return; - } - } - } - DisplayBuiltinVoteFail(vote, BuiltinVoteFail_Loses); + for (int i = 0; i < num_items; i++) + { + if (item_info[i][BUILTINVOTEINFO_ITEM_INDEX] == BUILTINVOTES_VOTE_YES) + { + if (item_info[i][BUILTINVOTEINFO_ITEM_VOTES] > (num_votes / 2)) + { + int Slots = StringToInt(g_sSlots, 10); + char Buffer[32]; + Format(Buffer, sizeof(Buffer), "%T", "LimitingSlots", LANG_SERVER); + DisplayBuiltinVotePass(vote, Buffer); + + g_hMaxPlayers.IntValue = Slots; + return; + } + } + } + DisplayBuiltinVoteFail(vote, BuiltinVoteFail_Loses); } -public void CVarChanged(Handle cvar, char[] oldValue, char[] newValue) +public void CvChg_MaxSlotsChanged(ConVar cvar, char[] oldValue, char[] newValue) { - MaxSlots = GetConVarInt(hMaxSlots); + MaxSlots = hMaxSlots.IntValue; } + +public void CvChg_MaxPlayersChanged(ConVar cvar, char[] oldValue, char[] newValue) +{ + L4DToolz_MaxPlayers.IntValue = g_hMaxPlayers.IntValue; + L4DToolz_VisibleMaxPlayers.IntValue = g_hMaxPlayers.IntValue; +} + +public void LGO_OnMatchModeLoaded() +{ + g_hMaxPlayers.IntValue = hMaxSlots.IntValue; +} + +public void LGO_OnMatchModeUnloaded() +{ + g_hMaxPlayers.IntValue = hMaxSlots.IntValue; +} \ No newline at end of file diff --git a/cfg/cfgogl/acemodrv/confogl.cfg b/cfg/cfgogl/acemodrv/confogl.cfg index 4bbb92ee8..2fa34dadd 100644 --- a/cfg/cfgogl/acemodrv/confogl.cfg +++ b/cfg/cfgogl/acemodrv/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "Acemod RV 1.3" +confogl_addcvar l4d_ready_cfg_name "Acemod RV 1.3" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/acemodrv/confogl_off.cfg b/cfg/cfgogl/acemodrv/confogl_off.cfg index 4d1be994b..7a2fd7215 100644 --- a/cfg/cfgogl/acemodrv/confogl_off.cfg +++ b/cfg/cfgogl/acemodrv/confogl_off.cfg @@ -7,9 +7,6 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -17,4 +14,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins \ No newline at end of file +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/acemodrv/confogl_plugins.cfg b/cfg/cfgogl/acemodrv/confogl_plugins.cfg index 1dad44bd9..e8298037d 100644 --- a/cfg/cfgogl/acemodrv/confogl_plugins.cfg +++ b/cfg/cfgogl/acemodrv/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Ace Shared Plugins //------------------------------------------- @@ -15,8 +26,18 @@ exec cfgogl/acemodrv/shared_plugins.cfg //------------------------------------------- // Ace 4v4 //------------------------------------------- -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx \ No newline at end of file +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/acemodrv/shared_cvars.cfg b/cfg/cfgogl/acemodrv/shared_cvars.cfg index 98b53ca28..b9f6028a0 100644 --- a/cfg/cfgogl/acemodrv/shared_cvars.cfg +++ b/cfg/cfgogl/acemodrv/shared_cvars.cfg @@ -24,8 +24,7 @@ confogl_addcvar versus_marker_num 0 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled 1 - +confogl_addcvar l4d_ready_enabled 1 confogl_addcvar l4d_ready_survivor_freeze 0 confogl_addcvar l4d_ready_delay 3 confogl_addcvar l4d_ready_enable_sound 1 @@ -42,7 +41,7 @@ confogl_match_restart "1" // Sets whet // Confogl Cvars confogl_addcvar confogl_boss_tank "1" // Tank can't be prelit, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player -confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed +//confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed confogl_addcvar confogl_lock_boss_spawns "1" // Enables forcing same coordinates for tank and witch spawns (excluding tanks during finales) confogl_addcvar confogl_remove_escape_tank "1" // Removes tanks which spawn as the rescue vehicle arrives on finales confogl_addcvar confogl_disable_tank_hordes "1" // Disables natural hordes while tanks are in play diff --git a/cfg/cfgogl/acemodrv/shared_plugins.cfg b/cfg/cfgogl/acemodrv/shared_plugins.cfg index bab3dcd7b..7afb91f71 100644 --- a/cfg/cfgogl/acemodrv/shared_plugins.cfg +++ b/cfg/cfgogl/acemodrv/shared_plugins.cfg @@ -7,129 +7,113 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= -//------------------------ -// Sourcemod Basic Plugins -//------------------------ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx - //---------------------------------- // General Competitive Plugins //---------------------------------- -sm plugins load optional/l4d2_pickup.smx -sm plugins load optional/blockheatseekingchargers.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_nospitterduringtank.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_unsilent_jockey.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d_jockey_ledgehang.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx -sm plugins load optional/l4d_witch_damage_announce.smx +sm_plugins_load optional/l4d2_pickup.smx +sm_plugins_load optional/blockheatseekingchargers.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_nospitterduringtank.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_unsilent_jockey.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d_jockey_ledgehang.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx +sm_plugins_load optional/l4d_witch_damage_announce.smx //---------------------- // Equilibrium Plugins //---------------------- -sm plugins load optional/eq_finale_tanks.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_jockey_skeet.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d2_spitblock.smx -sm plugins load optional/l4d2_uniform_spit.smx -sm plugins load optional/l4d_tank_painfade.smx -sm plugins load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/eq_finale_tanks.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_jockey_skeet.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d2_spitblock.smx +sm_plugins_load optional/l4d2_uniform_spit.smx +sm_plugins_load optional/l4d_tank_painfade.smx +sm_plugins_load optional/l4d_texture_manager_block.smx //---------------------- // EQ3 / Acemod //---------------------- -sm plugins load optional/l4d2_tank_charger_m2_fix.smx -sm plugins load optional/l4d2_smoker_drag_damage_interval.smx -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_ultra_witch.smx -sm plugins load optional/l4d2_horde_equaliser.smx -sm plugins load optional/l4d2_no_hunter_deadstops.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/boomer_horde_equalizer.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_tank_damage_cvars.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_hybrid_scoremod.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/fix_engine.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/specrates.smx -sm plugins load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/l4d2_tank_charger_m2_fix.smx +sm_plugins_load optional/l4d2_smoker_drag_damage_interval.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_ultra_witch.smx +sm_plugins_load optional/l4d2_horde_equaliser.smx +sm_plugins_load optional/l4d2_no_hunter_deadstops.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/boomer_horde_equalizer.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_tank_damage_cvars.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_hybrid_scoremod.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/fix_engine.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/specrates.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx //---------------------- // Static shotgun spread //---------------------- -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx //--------------------------------------------- // Merged FF Plugins, needs to be loaded here //--------------------------------------------- -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx //--------------------------- // Matchmaking Plugins //--------------------------- -sm plugins load optional/readyup.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/cfg_motd.smx -sm plugins load optional/spechud.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/witch_and_tankifier.smx - -// Letzzzz go. -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx \ No newline at end of file +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/cfg_motd.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/witch_and_tankifier.smx \ No newline at end of file diff --git a/cfg/cfgogl/acemodrv/shared_settings.cfg b/cfg/cfgogl/acemodrv/shared_settings.cfg index d1c3e4a26..78d331e03 100644 --- a/cfg/cfgogl/acemodrv/shared_settings.cfg +++ b/cfg/cfgogl/acemodrv/shared_settings.cfg @@ -95,7 +95,6 @@ confogl_addcvar l4d2_slowdown_water_survivors_during_tank 220 confogl_addcvar l4d2_slowdown_crouch_speed_mod 1.2 // [l4d2_horde_equaliser.smx] -confogl_addcvar l4d2_heq_allow_horde_during_tank 1 confogl_addcvar l4d2_heq_checkpoint_sound 1 // [l4d_tank_damage_announce.smx] diff --git a/cfg/cfgogl/amrv1v1/confogl.cfg b/cfg/cfgogl/amrv1v1/confogl.cfg index 20e065e8e..bdc956e23 100644 --- a/cfg/cfgogl/amrv1v1/confogl.cfg +++ b/cfg/cfgogl/amrv1v1/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "1v1 Acemod RV 1.3" +confogl_addcvar l4d_ready_cfg_name "1v1 Acemod RV 1.3" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/amrv1v1/confogl_plugins.cfg b/cfg/cfgogl/amrv1v1/confogl_plugins.cfg index 9fd700254..bf870c94d 100644 --- a/cfg/cfgogl/amrv1v1/confogl_plugins.cfg +++ b/cfg/cfgogl/amrv1v1/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Ace Shared Plugins //------------------------------------------- @@ -15,9 +26,19 @@ exec cfgogl/acemodrv/shared_plugins.cfg //------------------------------------------- // Ace 1v1 //------------------------------------------- -sm plugins load optional/1v1_skeetstats.smx -sm plugins load optional/1v1.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nobackjumps.smx \ No newline at end of file +sm_plugins_load optional/1v1_skeetstats.smx +sm_plugins_load optional/1v1.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nobackjumps.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/amrv2v2/confogl.cfg b/cfg/cfgogl/amrv2v2/confogl.cfg index 6656d0390..20b954bcf 100644 --- a/cfg/cfgogl/amrv2v2/confogl.cfg +++ b/cfg/cfgogl/amrv2v2/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "2v2 Acemod RV 1.3" +confogl_addcvar l4d_ready_cfg_name "2v2 Acemod RV 1.3" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/amrv2v2/confogl_plugins.cfg b/cfg/cfgogl/amrv2v2/confogl_plugins.cfg index d8b9d53ca..de084f094 100644 --- a/cfg/cfgogl/amrv2v2/confogl_plugins.cfg +++ b/cfg/cfgogl/amrv2v2/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Ace Shared Plugins //------------------------------------------- @@ -15,13 +26,23 @@ exec cfgogl/acemodrv/shared_plugins.cfg //------------------------------------------- // Ace 2v2 //------------------------------------------- -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nosey_parker.smx -sm plugins load optional/l4d2_nobackjumps.smx -sm plugins load optional/autopause.smx \ No newline at end of file +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nosey_parker.smx +sm_plugins_load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/autopause.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/amrv3v3/confogl.cfg b/cfg/cfgogl/amrv3v3/confogl.cfg index 8cfd1b3c7..6f13f9954 100644 --- a/cfg/cfgogl/amrv3v3/confogl.cfg +++ b/cfg/cfgogl/amrv3v3/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "3v3 Acemod RV 1.3" +confogl_addcvar l4d_ready_cfg_name "3v3 Acemod RV 1.3" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/amrv3v3/confogl_plugins.cfg b/cfg/cfgogl/amrv3v3/confogl_plugins.cfg index 09e71eeeb..71cbbcf82 100644 --- a/cfg/cfgogl/amrv3v3/confogl_plugins.cfg +++ b/cfg/cfgogl/amrv3v3/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Ace Shared Plugins //------------------------------------------- @@ -15,12 +26,22 @@ exec cfgogl/acemodrv/shared_plugins.cfg //------------------------------------------- // Ace 3v3 //------------------------------------------- -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nosey_parker.smx -sm plugins load optional/autopause.smx \ No newline at end of file +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nosey_parker.smx +sm_plugins_load optional/autopause.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/apex/confogl.cfg b/cfg/cfgogl/apex/confogl.cfg index b3d41fa49..e5ac1efb7 100644 --- a/cfg/cfgogl/apex/confogl.cfg +++ b/cfg/cfgogl/apex/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "Apex v1.1.2" +confogl_addcvar l4d_ready_cfg_name "Apex v1.1.2" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/apex/confogl_off.cfg b/cfg/cfgogl/apex/confogl_off.cfg index a420ebb0a..360ee6aff 100644 --- a/cfg/cfgogl/apex/confogl_off.cfg +++ b/cfg/cfgogl/apex/confogl_off.cfg @@ -7,9 +7,6 @@ // http://github.com/SirPlease/Apex // ======================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -17,4 +14,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins \ No newline at end of file +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/apex/confogl_plugins.cfg b/cfg/cfgogl/apex/confogl_plugins.cfg index 6ea785988..c484ec323 100644 --- a/cfg/cfgogl/apex/confogl_plugins.cfg +++ b/cfg/cfgogl/apex/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/SirPlease/Apex (hopefully I'll get to that repo one day) // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Apex Shared Plugins //------------------------------------------- @@ -15,8 +26,18 @@ exec cfgogl/apex/shared_plugins.cfg //------------------------------------------- // Apex 4v4 //------------------------------------------- -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx -sm plugins load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/apex/shared_cvars.cfg b/cfg/cfgogl/apex/shared_cvars.cfg index 472177a41..d520fe520 100644 --- a/cfg/cfgogl/apex/shared_cvars.cfg +++ b/cfg/cfgogl/apex/shared_cvars.cfg @@ -24,8 +24,7 @@ confogl_addcvar versus_marker_num 0 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled 1 - +confogl_addcvar l4d_ready_enabled 1 confogl_addcvar l4d_ready_survivor_freeze 0 confogl_addcvar l4d_ready_delay 3 confogl_addcvar l4d_ready_enable_sound 1 @@ -42,7 +41,7 @@ confogl_match_restart "1" // Sets whet // Confogl Cvars confogl_addcvar confogl_boss_tank "1" // Tank can't be prelit, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player -confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed +//confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed confogl_addcvar confogl_lock_boss_spawns "1" // Enables forcing same coordinates for tank and witch spawns (excluding tanks during finales) confogl_addcvar confogl_remove_escape_tank "1" // Removes tanks which spawn as the rescue vehicle arrives on finales confogl_addcvar confogl_disable_tank_hordes "1" // Disables natural hordes while tanks are in play diff --git a/cfg/cfgogl/apex/shared_plugins.cfg b/cfg/cfgogl/apex/shared_plugins.cfg index 9284dfa74..d7274f899 100644 --- a/cfg/cfgogl/apex/shared_plugins.cfg +++ b/cfg/cfgogl/apex/shared_plugins.cfg @@ -7,128 +7,112 @@ // http://github.com/SirPlease/Apex // ======================================================================================= -//------------------------ -// Sourcemod Basic Plugins -//------------------------ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx - //---------------------------------- // General Competitive Plugins //---------------------------------- -sm plugins load optional/l4d2_pickup.smx -sm plugins load optional/blockheatseekingchargers.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/ghost_hurt.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_unsilent_jockey.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d_jockey_ledgehang.smx -sm plugins load optional/l4d_no_cans.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx +sm_plugins_load optional/l4d2_pickup.smx +sm_plugins_load optional/blockheatseekingchargers.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/ghost_hurt.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_unsilent_jockey.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d_jockey_ledgehang.smx +sm_plugins_load optional/l4d_no_cans.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx //---------------------- // Equilibrium Plugins //---------------------- -sm plugins load optional/eq_finale_tanks.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/eq_finale_tanks.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d_texture_manager_block.smx //---------------------- // EQ3 / Acemod / ZoneMod / Apex //---------------------- -sm plugins load optional/l4d2_smoker_drag_damage_interval_zone.smx -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_no_m2_pulled_and_hunters.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/boomer_horde_equalizer.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_tank_damage_cvars.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_scoremod.smx -sm plugins load optional/l4d2_fireworks_noise_block.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/nm3_ladder_damage.smx -sm plugins load optional/fix_engine.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/l4d2_melee_shenanigans.smx -sm plugins load optional/specrates.smx -sm plugins load optional/l4d2_byedoor.smx -sm plugins load optional/l4d2_horde.smx -sm plugins load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/l4d2_smoker_drag_damage_interval_zone.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_no_m2_pulled_and_hunters.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/boomer_horde_equalizer.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_tank_damage_cvars.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_scoremod.smx +sm_plugins_load optional/l4d2_fireworks_noise_block.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/nm3_ladder_damage.smx +sm_plugins_load optional/fix_engine.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/l4d2_melee_shenanigans.smx +sm_plugins_load optional/specrates.smx +sm_plugins_load optional/l4d2_byedoor.smx +sm_plugins_load optional/l4d2_horde.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx //---------------------- // Static shotgun spread //---------------------- -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx //--------------------------------------------- // Merged FF Plugins, needs to be loaded here //--------------------------------------------- -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx //--------------------------- // Matchmaking Plugins //--------------------------- -sm plugins load optional/readyup.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/cfg_motd.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/spechud.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/witch_and_tankifier.smx - -// Letzzzz go. -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx \ No newline at end of file +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/cfg_motd.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/witch_and_tankifier.smx \ No newline at end of file diff --git a/cfg/cfgogl/deadman/confogl.cfg b/cfg/cfgogl/deadman/confogl.cfg index 2694a7474..84569a478 100644 --- a/cfg/cfgogl/deadman/confogl.cfg +++ b/cfg/cfgogl/deadman/confogl.cfg @@ -27,8 +27,8 @@ confogl_addcvar sv_vote_kick_ban_duration 1 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled "1" -l4d_ready_cfg_name "Deadman 5.0.3" +confogl_addcvar l4d_ready_enabled "1" +confogl_addcvar l4d_ready_cfg_name "Deadman 5.0.3" sm_addreadystring " " sm_lockstrings confogl_addcvar sm_safeitemkill_items 5 @@ -51,15 +51,15 @@ confogl_match_restart "1" // Confogl Cvars confogl_addcvar confogl_boss_tank "1" -confogl_addcvar confogl_boss_unprohibit "0" +//confogl_addcvar confogl_boss_unprohibit "0" confogl_addcvar confogl_lock_boss_spawns "1" confogl_addcvar confogl_remove_escape_tank "1" confogl_addcvar confogl_disable_tank_hordes "1" confogl_addcvar confogl_block_punch_rock "1" confogl_addcvar confogl_blockinfectedbots "2" confogl_addcvar director_allow_infected_bots "0" -confogl_addcvar confogl_ghost_warp "1" -confogl_addcvar confogl_ghost_warp_reload "1" +//confogl_addcvar confogl_ghost_warp "1" +//confogl_addcvar confogl_ghost_warp_reload "1" confogl_addcvar confogl_reduce_finalespawnrange "1" confogl_addcvar confogl_remove_chainsaw "1" confogl_addcvar confogl_remove_defib "1" diff --git a/cfg/cfgogl/deadman/confogl_off.cfg b/cfg/cfgogl/deadman/confogl_off.cfg index ec1cb219c..06a065673 100644 --- a/cfg/cfgogl/deadman/confogl_off.cfg +++ b/cfg/cfgogl/deadman/confogl_off.cfg @@ -6,9 +6,6 @@ // Version 5.0 // =================================================================================== -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -16,4 +13,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/deadman/confogl_plugins.cfg b/cfg/cfgogl/deadman/confogl_plugins.cfg index da3c43a56..9a547b13b 100644 --- a/cfg/cfgogl/deadman/confogl_plugins.cfg +++ b/cfg/cfgogl/deadman/confogl_plugins.cfg @@ -6,97 +6,98 @@ // Version 5.0 // =================================================================================== -// Sourcemod -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx +// Prepare for Plugin Loading +sm_plugins_load_unlock +sm_plugins_unload_all + +// Load General Fixes +exec generalfixes.cfg // Pro Mod Plugins -sm plugins load optional/1v1_skeetstats.smx -sm plugins load optional/1v1.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/ghost_hurt.smx -sm plugins load optional/infected_flow_warp.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/l4d_ci_ffblock.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d_no_cans.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_tank_rush.smx -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/l4d_texture_manager_block.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/l4d_witch_damage_announce.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_hittable_control.smx -sm plugins load optional/l4d2_ladder_rambos.smx -sm plugins load optional/l4d2_lagcomp_manager.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_melee_spawn_control.smx -sm plugins load optional/l4d2_nobackjumps.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_notankautoaim.smx -sm plugins load optional/l4d2_penalty_bonus.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_scoremod.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/simple_witch_bonus.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/staggersolver.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx -sm plugins load optional/witch_and_tankifier.smx +sm_plugins_load optional/1v1_skeetstats.smx +sm_plugins_load optional/1v1.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/ghost_hurt.smx +sm_plugins_load optional/infected_flow_warp.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/l4d_ci_ffblock.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d_no_cans.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_tank_rush.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/l4d_witch_damage_announce.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/l4d2_lagcomp_manager.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_melee_spawn_control.smx +sm_plugins_load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_notankautoaim.smx +sm_plugins_load optional/l4d2_penalty_bonus.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_scoremod.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/simple_witch_bonus.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/staggersolver.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx +sm_plugins_load optional/witch_and_tankifier.smx // Caster Support -sm plugins load optional/caster_assister.smx -sm plugins load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/caster_system.smx // Static shotgun spread -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx // Confogl -sm plugins load optional/readyup.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/spechud.smx -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx \ No newline at end of file +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/spechud.smx + +// Shared Plugins File +exec sharedplugins.cfg + +// Lock Plugins +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/deadman/deadman.cfg b/cfg/cfgogl/deadman/deadman.cfg index 8ac68ae02..5e1f3c8dc 100644 --- a/cfg/cfgogl/deadman/deadman.cfg +++ b/cfg/cfgogl/deadman/deadman.cfg @@ -68,7 +68,7 @@ confogl_addcvar gfc_spit_zc_flags 6 confogl_addcvar gfc_godframe_glows 0 // [l4d2_hittable_control.smx] -confogl_addcvar hc_bridge_car_damage 25.0 +//confogl_addcvar hc_bridge_car_damage 25.0 confogl_addcvar hc_sflog_standing_damage 100.0 confogl_addcvar hc_bhlog_standing_damage 100.0 confogl_addcvar hc_handtruck_standing_damage 8.0 @@ -111,7 +111,7 @@ confogl_addcvar l4d_tank_props_glow 0 // [l4d2_uncommon_blocker.smx] confogl_addcvar sm_uncinfblock_enabled 1 -confogl_addcvar sm_uncinfblock_types 127 +//confogl_addcvar sm_uncinfblock_types 127 // [l4d2_weaponrules.smx] l4d2_addweaponrule smg_mp5 smg_silenced diff --git a/cfg/cfgogl/eq/confogl.cfg b/cfg/cfgogl/eq/confogl.cfg index fa39d0a15..a387ef2e4 100644 --- a/cfg/cfgogl/eq/confogl.cfg +++ b/cfg/cfgogl/eq/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "Equilibrium 3.0c" +confogl_addcvar l4d_ready_cfg_name "Equilibrium 3.0c" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/eq/confogl_off.cfg b/cfg/cfgogl/eq/confogl_off.cfg index 4c82d5ce9..a2d850a1e 100644 --- a/cfg/cfgogl/eq/confogl_off.cfg +++ b/cfg/cfgogl/eq/confogl_off.cfg @@ -6,9 +6,6 @@ // http://github.com/Attano/Equilibrium // ======================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -16,4 +13,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/eq/confogl_plugins.cfg b/cfg/cfgogl/eq/confogl_plugins.cfg index 101cd8e19..5816b0947 100644 --- a/cfg/cfgogl/eq/confogl_plugins.cfg +++ b/cfg/cfgogl/eq/confogl_plugins.cfg @@ -6,6 +6,17 @@ // http://github.com/Attano/Equilibrium // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // EQ Shared Plugins //------------------------------------------- @@ -14,7 +25,17 @@ exec cfgogl/eq/shared_plugins.cfg //------------------------------------------- // EQ 4v4 //------------------------------------------- -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx \ No newline at end of file +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/eq/shared_cvars.cfg b/cfg/cfgogl/eq/shared_cvars.cfg index 87833bb7f..d9568c2d5 100644 --- a/cfg/cfgogl/eq/shared_cvars.cfg +++ b/cfg/cfgogl/eq/shared_cvars.cfg @@ -23,8 +23,7 @@ confogl_addcvar versus_marker_num 0 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled 1 - +confogl_addcvar l4d_ready_enabled 1 confogl_addcvar l4d_ready_survivor_freeze 0 confogl_addcvar l4d_ready_delay 3 confogl_addcvar l4d_ready_enable_sound 1 @@ -41,7 +40,7 @@ confogl_match_restart "1" // Sets whet // Confogl Cvars confogl_addcvar confogl_boss_tank "1" // Tank can't be prelit, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player -confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed +//confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed confogl_addcvar confogl_lock_boss_spawns "1" // Enables forcing same coordinates for tank and witch spawns (excluding tanks during finales) confogl_addcvar confogl_remove_escape_tank "1" // Removes tanks which spawn as the rescue vehicle arrives on finales confogl_addcvar confogl_disable_tank_hordes "1" // Disables natural hordes while tanks are in play diff --git a/cfg/cfgogl/eq/shared_plugins.cfg b/cfg/cfgogl/eq/shared_plugins.cfg index 026a512ec..1789018cc 100644 --- a/cfg/cfgogl/eq/shared_plugins.cfg +++ b/cfg/cfgogl/eq/shared_plugins.cfg @@ -6,129 +6,115 @@ // http://github.com/Attano/Equilibrium // ======================================================================================= -//------------------------ -// Sourcemod Basic Plugins -//------------------------ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx - //---------------------------------- // General Competitive Plugins //---------------------------------- -sm plugins load optional/blockheatseekingchargers.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/ghost_hurt.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_nospitterduringtank.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_unsilent_jockey.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d_jockey_ledgehang.smx -sm plugins load optional/l4d_no_cans.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx -sm plugins load optional/l4d_witch_damage_announce.smx +sm_plugins_load optional/blockheatseekingchargers.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/ghost_hurt.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_nospitterduringtank.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_unsilent_jockey.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d_jockey_ledgehang.smx +sm_plugins_load optional/l4d_no_cans.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx +sm_plugins_load optional/l4d_witch_damage_announce.smx //---------------------- // Equilibrium Plugins //---------------------- -sm plugins load optional/eq_finale_tanks.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_jockey_skeet.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_riotcops.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d2_spitblock.smx -sm plugins load optional/l4d2_uniform_spit.smx -sm plugins load optional/l4d_tank_painfade.smx -sm plugins load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/eq_finale_tanks.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_jockey_skeet.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_riotcops.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d2_spitblock.smx +sm_plugins_load optional/l4d2_uniform_spit.smx +sm_plugins_load optional/l4d_tank_painfade.smx +sm_plugins_load optional/l4d_texture_manager_block.smx //---------------------- // EQ3 //---------------------- -sm plugins load optional/l4d2_sniper_precache.smx -sm plugins load optional/l4d2_sniper_bodyshot.smx -sm plugins load optional/l4d2_tank_charger_m2_fix.smx -sm plugins load optional/l4d2_smoker_drag_damage_interval.smx -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_ultra_witch.smx -sm plugins load optional/l4d2_horde_equaliser.smx -sm plugins load optional/l4d2_no_hunter_deadstops.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/boomer_horde_equalizer.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_tank_melee_fury.smx -sm plugins load optional/l4d2_tank_damage_cvars.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_hybrid_scoremod.smx -sm plugins load optional/l4d2_fireworks_noise_block.smx -sm plugins load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/l4d2_sniper_precache.smx +sm_plugins_load optional/l4d2_sniper_bodyshot.smx +sm_plugins_load optional/l4d2_tank_charger_m2_fix.smx +sm_plugins_load optional/l4d2_smoker_drag_damage_interval.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_ultra_witch.smx +sm_plugins_load optional/l4d2_horde_equaliser.smx +sm_plugins_load optional/l4d2_no_hunter_deadstops.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/boomer_horde_equalizer.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_tank_melee_fury.smx +sm_plugins_load optional/l4d2_tank_damage_cvars.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_hybrid_scoremod.smx +sm_plugins_load optional/l4d2_fireworks_noise_block.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx //---------------------- // Static shotgun spread //---------------------- -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx //--------------------------------------------- // Merged FF Plugins, needs to be loaded here //--------------------------------------------- -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx //--------------------------- // Matchmaking Plugins //--------------------------- -sm plugins load optional/readyup.smx -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/spechud.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/witch_and_tankifier.smx -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx \ No newline at end of file +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/witch_and_tankifier.smx \ No newline at end of file diff --git a/cfg/cfgogl/eq1v1/confogl.cfg b/cfg/cfgogl/eq1v1/confogl.cfg index 0c2b00e3a..6f38ba920 100644 --- a/cfg/cfgogl/eq1v1/confogl.cfg +++ b/cfg/cfgogl/eq1v1/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "1v1 EQ 3.0c" +confogl_addcvar l4d_ready_cfg_name "1v1 EQ 3.0c" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/eq1v1/confogl_plugins.cfg b/cfg/cfgogl/eq1v1/confogl_plugins.cfg index eb7aecddb..8597513bc 100644 --- a/cfg/cfgogl/eq1v1/confogl_plugins.cfg +++ b/cfg/cfgogl/eq1v1/confogl_plugins.cfg @@ -6,13 +6,26 @@ // http://github.com/Attano/Equilibrium // ======================================================================================= +// Prepare for Plugin Loading +sm_plugins_load_unlock +sm_plugins_unload_all + +// Load General Fixes +exec generalfixes.cfg + // EQ Shared Plugins exec cfgogl/eq/shared_plugins.cfg // EQ 1v1 -sm plugins load optional/1v1_skeetstats.smx -sm plugins load optional/1v1.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nobackjumps.smx \ No newline at end of file +sm_plugins_load optional/1v1_skeetstats.smx +sm_plugins_load optional/1v1.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nobackjumps.smx + +// Shared Plugins File +exec sharedplugins.cfg + +// Lock Plugins +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/eq2v2/confogl.cfg b/cfg/cfgogl/eq2v2/confogl.cfg index 9d8a9ee50..1ffb9e7ed 100644 --- a/cfg/cfgogl/eq2v2/confogl.cfg +++ b/cfg/cfgogl/eq2v2/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "2v2 EQ 3.0c" +confogl_addcvar l4d_ready_cfg_name "2v2 EQ 3.0c" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/eq2v2/confogl_plugins.cfg b/cfg/cfgogl/eq2v2/confogl_plugins.cfg index aab7e9766..c6ccdcad1 100644 --- a/cfg/cfgogl/eq2v2/confogl_plugins.cfg +++ b/cfg/cfgogl/eq2v2/confogl_plugins.cfg @@ -6,16 +6,29 @@ // http://github.com/Attano/Equilibrium // ======================================================================================= +// Prepare for Plugin Loading +sm_plugins_load_unlock +sm_plugins_unload_all + +// Load General Fixes +exec generalfixes.cfg + // EQ Shared Plugins exec cfgogl/eq/shared_plugins.cfg // EQ 2v2 -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nobackjumps.smx -sm plugins load optional/l4d2_nosey_parker.smx \ No newline at end of file +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/l4d2_nosey_parker.smx + +// Shared Plugins File +exec sharedplugins.cfg + +// Lock Plugins +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/eq3v3/confogl.cfg b/cfg/cfgogl/eq3v3/confogl.cfg index bccac0068..450f19ae3 100644 --- a/cfg/cfgogl/eq3v3/confogl.cfg +++ b/cfg/cfgogl/eq3v3/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "3v3 EQ 3.0c" +confogl_addcvar l4d_ready_cfg_name "3v3 EQ 3.0c" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/eq3v3/confogl_plugins.cfg b/cfg/cfgogl/eq3v3/confogl_plugins.cfg index 13759c422..6bc66e701 100644 --- a/cfg/cfgogl/eq3v3/confogl_plugins.cfg +++ b/cfg/cfgogl/eq3v3/confogl_plugins.cfg @@ -6,16 +6,29 @@ // http://github.com/Attano/Equilibrium // ======================================================================================= +// Prepare for Plugin Loading +sm_plugins_load_unlock +sm_plugins_unload_all + +// Load General Fixes +exec generalfixes.cfg + // EQ Shared Plugins exec cfgogl/eq/shared_plugins.cfg // EQ 3v3 -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nobackjumps.smx -sm plugins load optional/l4d2_nosey_parker.smx \ No newline at end of file +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/l4d2_nosey_parker.smx + +// Shared Plugins File +exec sharedplugins.cfg + +// Lock Plugins +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/neomod/confogl.cfg b/cfg/cfgogl/neomod/confogl.cfg index 53babc5e7..1e8d25f72 100644 --- a/cfg/cfgogl/neomod/confogl.cfg +++ b/cfg/cfgogl/neomod/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "NeoMod Tourney 0.4a" +confogl_addcvar l4d_ready_cfg_name "NeoMod Tourney 0.4a" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/neomod/confogl_off.cfg b/cfg/cfgogl/neomod/confogl_off.cfg index d058bc8b4..a51834d3b 100644 --- a/cfg/cfgogl/neomod/confogl_off.cfg +++ b/cfg/cfgogl/neomod/confogl_off.cfg @@ -7,9 +7,6 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -17,4 +14,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins \ No newline at end of file +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/neomod/confogl_plugins.cfg b/cfg/cfgogl/neomod/confogl_plugins.cfg index 889ec86e9..957ea93e4 100644 --- a/cfg/cfgogl/neomod/confogl_plugins.cfg +++ b/cfg/cfgogl/neomod/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // ZoneMod Shared Plugins //------------------------------------------- @@ -15,9 +26,19 @@ exec cfgogl/neomod/shared_plugins.cfg //------------------------------------------- // ZoneMod 4v4 //------------------------------------------- -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx -sm plugins load optional/l4d2_tongue_timer.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx +sm_plugins_load optional/l4d2_tongue_timer.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/neomod/shared_cvars.cfg b/cfg/cfgogl/neomod/shared_cvars.cfg index 3ccfcac8d..9a83348ce 100644 --- a/cfg/cfgogl/neomod/shared_cvars.cfg +++ b/cfg/cfgogl/neomod/shared_cvars.cfg @@ -24,8 +24,7 @@ confogl_addcvar versus_marker_num 0 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled 1 - +confogl_addcvar l4d_ready_enabled 1 confogl_addcvar l4d_ready_survivor_freeze 0 confogl_addcvar l4d_ready_delay 3 confogl_addcvar l4d_ready_enable_sound 1 @@ -42,7 +41,7 @@ confogl_match_restart "1" // Sets whet // Confogl Cvars confogl_addcvar confogl_boss_tank "1" // Tank can't be prelit, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player -confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed +//confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed confogl_addcvar confogl_lock_boss_spawns "1" // Enables forcing same coordinates for tank and witch spawns (excluding tanks during finales) confogl_addcvar confogl_remove_escape_tank "1" // Removes tanks which spawn as the rescue vehicle arrives on finales confogl_addcvar confogl_disable_tank_hordes "1" // Disables natural hordes while tanks are in play diff --git a/cfg/cfgogl/neomod/shared_plugins.cfg b/cfg/cfgogl/neomod/shared_plugins.cfg index 0af6ccc39..bb99902b1 100644 --- a/cfg/cfgogl/neomod/shared_plugins.cfg +++ b/cfg/cfgogl/neomod/shared_plugins.cfg @@ -7,142 +7,124 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= -//------------------------ -// Sourcemod Basic Plugins -//------------------------ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx - //---------------------------------- // General Competitive Plugins //---------------------------------- -sm plugins load optional/l4d2_pickup.smx -sm plugins load optional/blockheatseekingchargers.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_nospitterduringtank.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_unsilent_jockey.smx -sm plugins load optional/l4d2_nobackjumps.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d2_horde_equaliser.smx -sm plugins load optional/l4d_jockey_ledgehang.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx +sm_plugins_load optional/l4d2_pickup.smx +sm_plugins_load optional/blockheatseekingchargers.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_nospitterduringtank.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_unsilent_jockey.smx +sm_plugins_load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d2_horde_equaliser.smx +sm_plugins_load optional/l4d_jockey_ledgehang.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx //---------------------- // Equilibrium Plugins //---------------------- -sm plugins load optional/eq_finale_tanks.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d2_spitblock.smx -sm plugins load optional/l4d2_uniform_spit.smx -sm plugins load optional/l4d_tank_painfade.smx -sm plugins load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/eq_finale_tanks.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d2_spitblock.smx +sm_plugins_load optional/l4d2_uniform_spit.smx +sm_plugins_load optional/l4d_tank_painfade.smx +sm_plugins_load optional/l4d_texture_manager_block.smx //---------------------- // EQ3 / Acemod / ZoneMod //---------------------- -sm plugins load optional/l4d2_smoker_drag_damage_interval_zone.smx -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_hunter_no_deadstops.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/boomer_horde_equalizer.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_tank_damage_cvars.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_hybrid_scoremod_zone.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/fix_engine.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/l4d2_melee_shenanigans.smx -sm plugins load optional/specrates.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/l4d2_fix_spawn_order.smx -sm plugins load optional/l4dhots.smx -sm plugins load optional/l4d_tank_rush.smx -sm plugins load optional/l4d2_ladder_rambos.smx -sm plugins load optional/l4d2_reload_fix.smx -sm plugins load optional/noteam_nudging.smx -sm plugins load optional/charger_incap_damage.smx - -sm plugins load optional/l4d2_melee_spawn_control.smx +sm_plugins_load optional/l4d2_smoker_drag_damage_interval_zone.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_hunter_no_deadstops.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/boomer_horde_equalizer.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_tank_damage_cvars.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_hybrid_scoremod_zone.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/fix_engine.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/l4d2_melee_shenanigans.smx +sm_plugins_load optional/specrates.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4d2_fix_spawn_order.smx +sm_plugins_load optional/l4dhots.smx +sm_plugins_load optional/l4d_tank_rush.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/l4d2_reload_fix.smx +sm_plugins_load optional/noteam_nudging.smx +sm_plugins_load optional/charger_incap_damage.smx +sm_plugins_load optional/l4d2_melee_spawn_control.smx //---------------------- // Static shotgun spread //---------------------- -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx //--------------------------------------------- // Merged FF Plugins, needs to be loaded here //--------------------------------------------- -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx //--------------------------- // Matchmaking Plugins //--------------------------- -sm plugins load optional/readyup.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/cfg_motd.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/spechud.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/witch_and_tankifier.smx +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/cfg_motd.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/witch_and_tankifier.smx // Neomod specific stuff sm plugins unload fixes/l4d2_lagcomp_manager.smx -sm plugins load optional/l4d_rock_lagcomp.smx -sm plugins load optional/l4d2_magnum_incap.smx - -// Letzzzz go. -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx - +sm_plugins_load optional/l4d_rock_lagcomp.smx +sm_plugins_load optional/l4d2_magnum_incap.smx \ No newline at end of file diff --git a/cfg/cfgogl/nextmod/confogl_off.cfg b/cfg/cfgogl/nextmod/confogl_off.cfg index fd9a07361..9452b4075 100644 --- a/cfg/cfgogl/nextmod/confogl_off.cfg +++ b/cfg/cfgogl/nextmod/confogl_off.cfg @@ -7,9 +7,6 @@ // http://github.com/spoon-l4d2/nextmod // ======================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -17,4 +14,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins \ No newline at end of file +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/nextmod/confogl_plugins.cfg b/cfg/cfgogl/nextmod/confogl_plugins.cfg index 22b8c2c4d..5cf385e33 100644 --- a/cfg/cfgogl/nextmod/confogl_plugins.cfg +++ b/cfg/cfgogl/nextmod/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/spoon-l4d2/nextmod // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Shared Plugins //------------------------------------------- @@ -15,7 +26,17 @@ exec cfgogl/nextmod/shared_plugins.cfg //------------------------------------------- // NextMod 4v4 //------------------------------------------- -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/l4d_blackandwhite.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/l4d_blackandwhite.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/nextmod/shared_cvars.cfg b/cfg/cfgogl/nextmod/shared_cvars.cfg index 5884c1bda..65f3efc8a 100644 --- a/cfg/cfgogl/nextmod/shared_cvars.cfg +++ b/cfg/cfgogl/nextmod/shared_cvars.cfg @@ -21,8 +21,7 @@ confogl_addcvar vs_max_team_switches 9999 confogl_addcvar versus_marker_num 0 // ReadyUp Cvars -l4d_ready_enabled 1 - +confogl_addcvar l4d_ready_enabled 1 confogl_addcvar l4d_ready_survivor_freeze 0 confogl_addcvar l4d_ready_delay 3 confogl_addcvar l4d_ready_enable_sound 1 @@ -39,7 +38,7 @@ confogl_match_restart "1" // Sets whet // Confogl Cvars confogl_addcvar confogl_boss_tank "1" // Tank can't be prelit, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player -confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed +//confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed confogl_addcvar confogl_lock_boss_spawns "1" // Enables forcing same coordinates for tank and witch spawns (excluding tanks during finales) confogl_addcvar confogl_remove_escape_tank "1" // Removes tanks which spawn as the rescue vehicle arrives on finales confogl_addcvar confogl_disable_tank_hordes "1" // Disables natural hordes while tanks are in play diff --git a/cfg/cfgogl/nextmod/shared_plugins.cfg b/cfg/cfgogl/nextmod/shared_plugins.cfg index f3935802b..055fbbb41 100644 --- a/cfg/cfgogl/nextmod/shared_plugins.cfg +++ b/cfg/cfgogl/nextmod/shared_plugins.cfg @@ -1,105 +1,120 @@ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx -sm plugins load optional/l4d2_pickup.smx -sm plugins load optional/blockheatseekingchargers.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/8ball.smx -sm plugins load optional/changelog.smx -sm plugins load optional/current.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/ghost_hurt.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_nospitterduringtank.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_unsilent_jockey.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_jockey_ledgehang.smx -sm plugins load optional/l4d_no_cans.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx -sm plugins load optional/eq_finale_tanks.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d2_spitblock.smx -sm plugins load optional/l4d2_uniform_spit.smx -sm plugins load optional/l4d_tank_painfade.smx -sm plugins load optional/l4d_texture_manager_block.smx -sm plugins load optional/l4d2_smoker_drag_damage_interval_zone.smx -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_horde_equaliser.smx -sm plugins load optional/l4d2_hunter_no_deadstops.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/boomer_horde_equalizer.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_tank_damage_cvars.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_hybrid_scoremod_zone.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/nm3_ladder_damage.smx -sm plugins load optional/fix_engine.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/l4d2_melee_shenanigans.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/l4dhots.smx -sm plugins load optional/MeleeInTheSafeRoom.smx -sm plugins load optional/l4d2_fix_spawn_order.smx -sm plugins load optional/l4d2_sounds_blocker.smx -sm plugins load optional/autopause.smx -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx -sm plugins load optional/readyup.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/l4d2_ladder_rambos.smx -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/cfg_motd.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/spechud.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/witch_and_tankifier.smx -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx \ No newline at end of file +// Why all comments were deleted? + +//---------------------------------- +// General Competitive Plugins +//---------------------------------- +sm_plugins_load optional/l4d2_pickup.smx +sm_plugins_load optional/blockheatseekingchargers.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/8ball.smx +sm_plugins_load optional/changelog.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/ghost_hurt.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_nospitterduringtank.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_unsilent_jockey.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_jockey_ledgehang.smx +sm_plugins_load optional/l4d_no_cans.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx + +//---------------------- +// Equilibrium Plugins +//---------------------- +sm_plugins_load optional/eq_finale_tanks.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d2_spitblock.smx +sm_plugins_load optional/l4d2_uniform_spit.smx +sm_plugins_load optional/l4d_tank_painfade.smx +sm_plugins_load optional/l4d_texture_manager_block.smx + +//---------------------- +// EQ3 / Acemod / ZoneMod +//---------------------- +sm_plugins_load optional/l4d2_smoker_drag_damage_interval_zone.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_horde_equaliser.smx +sm_plugins_load optional/l4d2_hunter_no_deadstops.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/boomer_horde_equalizer.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_tank_damage_cvars.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_hybrid_scoremod_zone.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/nm3_ladder_damage.smx +sm_plugins_load optional/fix_engine.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/l4d2_melee_shenanigans.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4dhots.smx +sm_plugins_load optional/MeleeInTheSafeRoom.smx +sm_plugins_load optional/l4d2_fix_spawn_order.smx +sm_plugins_load optional/l4d2_sounds_blocker.smx +sm_plugins_load optional/autopause.smx + +//---------------------- +// Static shotgun spread +//---------------------- +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx + +//--------------------------------------------- +// Merged FF Plugins, needs to be loaded here +//--------------------------------------------- +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx + +//--------------------------- +// Matchmaking Plugins +//--------------------------- +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/cfg_motd.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/witch_and_tankifier.smx \ No newline at end of file diff --git a/cfg/cfgogl/nextmod1v1/confogl_plugins.cfg b/cfg/cfgogl/nextmod1v1/confogl_plugins.cfg index 82c79fd8b..2bdf1290b 100644 --- a/cfg/cfgogl/nextmod1v1/confogl_plugins.cfg +++ b/cfg/cfgogl/nextmod1v1/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/spoon-l4d2/nextmod // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Shared Plugins //------------------------------------------- @@ -15,8 +26,18 @@ exec cfgogl/nextmod/shared_plugins.cfg //------------------------------------------- // NextMod 1v1 //------------------------------------------- -sm plugins load optional/1v1.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/1v1.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nobackjumps.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/nextmod2v2/confogl_plugins.cfg b/cfg/cfgogl/nextmod2v2/confogl_plugins.cfg index 86396cf14..b0cfc4fa2 100644 --- a/cfg/cfgogl/nextmod2v2/confogl_plugins.cfg +++ b/cfg/cfgogl/nextmod2v2/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/spoon-l4d2/nextmod // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Shared Plugins //------------------------------------------- @@ -15,9 +26,19 @@ exec cfgogl/nextmod/shared_plugins.cfg //------------------------------------------- // NextMod 2v2 //------------------------------------------- -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/l4d_blackandwhite.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/l4d_blackandwhite.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/nextmod3v3/confogl.cfg b/cfg/cfgogl/nextmod3v3/confogl.cfg index e5d1261fe..fe26f5447 100644 --- a/cfg/cfgogl/nextmod3v3/confogl.cfg +++ b/cfg/cfgogl/nextmod3v3/confogl.cfg @@ -38,7 +38,6 @@ confogl_addcvar z_jockey_ride_damage_interval 0.25 confogl_addcvar z_pounce_damage 2 confogl_addcvar z_pounce_damage_interval 0.2 confogl_addcvar hunter_pz_claw_dmg 4 -confogl_addcvar z_tank_health 3350 // Nah tanks, ye Witchies confogl_addcvar versus_tank_chance 0 diff --git a/cfg/cfgogl/nextmod3v3/confogl_plugins.cfg b/cfg/cfgogl/nextmod3v3/confogl_plugins.cfg index 86396cf14..b0cfc4fa2 100644 --- a/cfg/cfgogl/nextmod3v3/confogl_plugins.cfg +++ b/cfg/cfgogl/nextmod3v3/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/spoon-l4d2/nextmod // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // Shared Plugins //------------------------------------------- @@ -15,9 +26,19 @@ exec cfgogl/nextmod/shared_plugins.cfg //------------------------------------------- // NextMod 2v2 //------------------------------------------- -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/l4d_blackandwhite.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/l4d_blackandwhite.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/pmelite/confogl.cfg b/cfg/cfgogl/pmelite/confogl.cfg index b2a366cec..54f7c2d7a 100644 --- a/cfg/cfgogl/pmelite/confogl.cfg +++ b/cfg/cfgogl/pmelite/confogl.cfg @@ -30,8 +30,8 @@ confogl_addcvar sv_vote_kick_ban_duration 1 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled "1" -l4d_ready_cfg_name "Pro Mod Elite 1.1" +confogl_addcvar l4d_ready_enabled "1" +confogl_addcvar l4d_ready_cfg_name "Pro Mod Elite 1.1" sm_addreadystring " " sm_lockstrings confogl_addcvar sm_safeitemkill_items 5 @@ -52,7 +52,7 @@ confogl_match_restart "1" // Confogl Cvars confogl_addcvar confogl_boss_tank "1" -confogl_addcvar confogl_boss_unprohibit "0" +//confogl_addcvar confogl_boss_unprohibit "0" confogl_addcvar confogl_lock_boss_spawns "1" confogl_addcvar confogl_remove_escape_tank "1" confogl_addcvar confogl_disable_tank_hordes "1" diff --git a/cfg/cfgogl/pmelite/confogl_off.cfg b/cfg/cfgogl/pmelite/confogl_off.cfg index a1c1f48c0..b1bcfe4a3 100644 --- a/cfg/cfgogl/pmelite/confogl_off.cfg +++ b/cfg/cfgogl/pmelite/confogl_off.cfg @@ -7,9 +7,6 @@ // https://github.com/SirPlease/L4D2-Competitive-Rework // ======================================================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -17,4 +14,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins \ No newline at end of file +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/pmelite/confogl_plugins.cfg b/cfg/cfgogl/pmelite/confogl_plugins.cfg index 7fd350384..f6e3caa20 100644 --- a/cfg/cfgogl/pmelite/confogl_plugins.cfg +++ b/cfg/cfgogl/pmelite/confogl_plugins.cfg @@ -7,118 +7,115 @@ // https://github.com/SirPlease/L4D2-Competitive-Rework // ======================================================================================================================= -//------------------------ -// Sourcemod Basic Plugins -//------------------------ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx +// Prepare for Plugin Loading +sm_plugins_load_unlock +sm_plugins_unload_all + +// Load General Fixes +exec generalfixes.cfg // Pro Mod Plugins -sm plugins load optional/l4d2_pickup.smx -sm plugins load optional/autopause.smx -sm plugins load optional/blockheatseekingchargers.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/boomer_horde_equalizer.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/finale_tank_blocker.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/ghost_hurt.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_ci_ffblock.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d_jockey_ledgehang.smx -sm plugins load optional/l4d_no_cans.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/l4d_texture_manager_block.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_nospitterduringtank.smx -sm plugins load optional/l4d2_notankautoaim.smx -sm plugins load optional/l4d2_penalty_bonus.smx -sm plugins load optional/holdout_bonus.smx //needs to be after penalty_bonus -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_scoremod.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_smoker_drag_damage_interval_zone.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/l4d2_spitblock.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/l4d2_uniform_spit.smx -sm plugins load optional/l4d2_unsilent_jockey.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4dhots.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nm3_ladder_damage.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/simple_witch_bonus.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/staggersolver.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx -sm plugins load optional/l4d_witch_damage_announce.smx -sm plugins load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d2_pickup.smx +sm_plugins_load optional/autopause.smx +sm_plugins_load optional/blockheatseekingchargers.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/boomer_horde_equalizer.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/finale_tank_blocker.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/ghost_hurt.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_ci_ffblock.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d_jockey_ledgehang.smx +sm_plugins_load optional/l4d_no_cans.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_nospitterduringtank.smx +sm_plugins_load optional/l4d2_notankautoaim.smx +sm_plugins_load optional/l4d2_penalty_bonus.smx +sm_plugins_load optional/holdout_bonus.smx //needs to be after penalty_bonus +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_scoremod.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_smoker_drag_damage_interval_zone.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/l4d2_spitblock.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/l4d2_uniform_spit.smx +sm_plugins_load optional/l4d2_unsilent_jockey.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4dhots.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nm3_ladder_damage.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/simple_witch_bonus.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/staggersolver.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx +sm_plugins_load optional/l4d_witch_damage_announce.smx +sm_plugins_load optional/l4d2_slowdown_control.smx // Static shotgun spread -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx -sm plugins load optional/l4d2_melee_shenanigans.smx -sm plugins load optional/fix_engine.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_hunter_no_deadstops.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_fireworks_noise_block.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_melee_shenanigans.smx +sm_plugins_load optional/fix_engine.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_hunter_no_deadstops.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_fireworks_noise_block.smx // Confogl -sm plugins load optional/readyup.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/spechud.smx -sm plugins load optional/witch_and_tankifier.smx +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/witch_and_tankifier.smx // Caster Support -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx + +// Shared Plugins File +exec sharedplugins.cfg -// Go Go ! -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx \ No newline at end of file +// Lock Plugins +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/pmelite/pmelite.cfg b/cfg/cfgogl/pmelite/pmelite.cfg index 5bf7e926e..eec9cc361 100644 --- a/cfg/cfgogl/pmelite/pmelite.cfg +++ b/cfg/cfgogl/pmelite/pmelite.cfg @@ -137,7 +137,7 @@ confogl_addcvar gfc_ff_min_time 0.8 // [l4d2_m2_control.smx] confogl_addcvar z_max_hunter_pounce_stagger_duration 1 -confogl_addcvar l4d2_deadstop_penalty 1 +//confogl_addcvar l4d2_deadstop_penalty 1 //[l4d2_si_staggers.smx] confogl_addcvar l4d2_disable_si_friendly_staggers 4 diff --git a/cfg/cfgogl/zh1v1/confogl.cfg b/cfg/cfgogl/zh1v1/confogl.cfg index 04b70bfd4..2c49e2118 100644 --- a/cfg/cfgogl/zh1v1/confogl.cfg +++ b/cfg/cfgogl/zh1v1/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "1v1 [Zone]Hunters v2.8.9" +confogl_addcvar l4d_ready_cfg_name "1v1 [Zone]Hunters v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zh1v1/confogl_plugins.cfg b/cfg/cfgogl/zh1v1/confogl_plugins.cfg index 35e589c94..76a00c4c1 100644 --- a/cfg/cfgogl/zh1v1/confogl_plugins.cfg +++ b/cfg/cfgogl/zh1v1/confogl_plugins.cfg @@ -6,6 +6,17 @@ // https://github.com/SirPlease/L4D2-Competitive-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // ZoneHunters Shared Plugins //------------------------------------------- @@ -14,9 +25,19 @@ exec cfgogl/zonehunters/shared_plugins.cfg //------------------------------------------- // ZoneHunters 1v1 //------------------------------------------- -sm plugins load optional/1v1_skeetstats.smx -sm plugins load optional/1v1.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nobackjumps.smx \ No newline at end of file +sm_plugins_load optional/1v1_skeetstats.smx +sm_plugins_load optional/1v1.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nobackjumps.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zh2v2/confogl.cfg b/cfg/cfgogl/zh2v2/confogl.cfg index 1eb13bb57..78c75f100 100644 --- a/cfg/cfgogl/zh2v2/confogl.cfg +++ b/cfg/cfgogl/zh2v2/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "2v2 [Zone]Hunters v2.8.9" +confogl_addcvar l4d_ready_cfg_name "2v2 [Zone]Hunters v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zh2v2/confogl_plugins.cfg b/cfg/cfgogl/zh2v2/confogl_plugins.cfg index 976561363..73ce8c124 100644 --- a/cfg/cfgogl/zh2v2/confogl_plugins.cfg +++ b/cfg/cfgogl/zh2v2/confogl_plugins.cfg @@ -6,6 +6,17 @@ // https://github.com/SirPlease/L4D2-Competitive-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // ZoneHunters Shared Plugins //------------------------------------------- @@ -14,13 +25,23 @@ exec cfgogl/zonehunters/shared_plugins.cfg //------------------------------------------- // ZoneHunters 2v2 //------------------------------------------- -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nosey_parker.smx -sm plugins load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nosey_parker.smx +sm_plugins_load optional/l4d2_nobackjumps.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zh3v3/confogl.cfg b/cfg/cfgogl/zh3v3/confogl.cfg index ce991d660..6a09f6c40 100644 --- a/cfg/cfgogl/zh3v3/confogl.cfg +++ b/cfg/cfgogl/zh3v3/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "3v3 [Zone]Hunters v2.8.9" +confogl_addcvar l4d_ready_cfg_name "3v3 [Zone]Hunters v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zh3v3/confogl_plugins.cfg b/cfg/cfgogl/zh3v3/confogl_plugins.cfg index 976561363..73ce8c124 100644 --- a/cfg/cfgogl/zh3v3/confogl_plugins.cfg +++ b/cfg/cfgogl/zh3v3/confogl_plugins.cfg @@ -6,6 +6,17 @@ // https://github.com/SirPlease/L4D2-Competitive-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // ZoneHunters Shared Plugins //------------------------------------------- @@ -14,13 +25,23 @@ exec cfgogl/zonehunters/shared_plugins.cfg //------------------------------------------- // ZoneHunters 2v2 //------------------------------------------- -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nosey_parker.smx -sm plugins load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nosey_parker.smx +sm_plugins_load optional/l4d2_nobackjumps.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zm1v1/confogl.cfg b/cfg/cfgogl/zm1v1/confogl.cfg index 4114fc93a..15cf1050f 100644 --- a/cfg/cfgogl/zm1v1/confogl.cfg +++ b/cfg/cfgogl/zm1v1/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "1v1 Zonemod v2.8.9" +confogl_addcvar l4d_ready_cfg_name "1v1 Zonemod v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zm1v1/confogl_plugins.cfg b/cfg/cfgogl/zm1v1/confogl_plugins.cfg index e3cfd20ed..8d34535a0 100644 --- a/cfg/cfgogl/zm1v1/confogl_plugins.cfg +++ b/cfg/cfgogl/zm1v1/confogl_plugins.cfg @@ -7,12 +7,25 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +// Prepare for Plugin Loading +sm_plugins_load_unlock +sm_plugins_unload_all + +// Load General Fixes +exec generalfixes.cfg + // ZoneMod Shared Plugins exec cfgogl/zonemod/shared_plugins.cfg // ZoneMod 1v1 -sm plugins load optional/1v1_skeetstats.smx -sm plugins load optional/1v1.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx \ No newline at end of file +sm_plugins_load optional/1v1_skeetstats.smx +sm_plugins_load optional/1v1.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx + +// Shared Plugins File +exec sharedplugins.cfg + +// Lock Plugins +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zm2v2/confogl.cfg b/cfg/cfgogl/zm2v2/confogl.cfg index 3878685b7..93edf57f4 100644 --- a/cfg/cfgogl/zm2v2/confogl.cfg +++ b/cfg/cfgogl/zm2v2/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "2v2 Zonemod v2.8.9" +confogl_addcvar l4d_ready_cfg_name "2v2 Zonemod v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zm2v2/confogl_plugins.cfg b/cfg/cfgogl/zm2v2/confogl_plugins.cfg index eb41bab11..eb84f03a4 100644 --- a/cfg/cfgogl/zm2v2/confogl_plugins.cfg +++ b/cfg/cfgogl/zm2v2/confogl_plugins.cfg @@ -7,16 +7,29 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +// Prepare for Plugin Loading +sm_plugins_load_unlock +sm_plugins_unload_all + +// Load General Fixes +exec generalfixes.cfg + // ZoneMod Shared Plugins exec cfgogl/zonemod/shared_plugins.cfg // ZoneMod 2v2 -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nosey_parker.smx -sm plugins load optional/autopause.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nosey_parker.smx +sm_plugins_load optional/autopause.smx + +// Shared Plugins File +exec sharedplugins.cfg + +// Lock Plugins +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zm3v3/confogl.cfg b/cfg/cfgogl/zm3v3/confogl.cfg index 7e8ef1563..0aba13573 100644 --- a/cfg/cfgogl/zm3v3/confogl.cfg +++ b/cfg/cfgogl/zm3v3/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "3v3 Zonemod v2.8.9" +confogl_addcvar l4d_ready_cfg_name "3v3 Zonemod v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zm3v3/confogl_plugins.cfg b/cfg/cfgogl/zm3v3/confogl_plugins.cfg index ecbe0922d..c66f5858e 100644 --- a/cfg/cfgogl/zm3v3/confogl_plugins.cfg +++ b/cfg/cfgogl/zm3v3/confogl_plugins.cfg @@ -7,17 +7,30 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +// Prepare for Plugin Loading +sm_plugins_load_unlock +sm_plugins_unload_all + +// Load General Fixes +exec generalfixes.cfg + // ZoneMod Shared Plugins exec cfgogl/zonemod/shared_plugins.cfg // ZoneMod 3v3 -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/aitankgank.smx -sm plugins load optional/l4d2_character_fix.smx -sm plugins load optional/l4d2_director_commonlimit_block.smx -sm plugins load optional/l4d_mapbased_cvars.smx -sm plugins load optional/l4d2_nosey_parker.smx -sm plugins load optional/autopause.smx -sm plugins load optional/l4d2_tongue_timer.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/aitankgank.smx +sm_plugins_load optional/l4d2_character_fix.smx +sm_plugins_load optional/l4d2_director_commonlimit_block.smx +sm_plugins_load optional/l4d_mapbased_cvars.smx +sm_plugins_load optional/l4d2_nosey_parker.smx +sm_plugins_load optional/autopause.smx +sm_plugins_load optional/l4d2_tongue_timer.smx + +// Shared Plugins File +exec sharedplugins.cfg + +// Lock Plugins +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zonehunters/confogl.cfg b/cfg/cfgogl/zonehunters/confogl.cfg index 6196252a4..5b8c0f947 100644 --- a/cfg/cfgogl/zonehunters/confogl.cfg +++ b/cfg/cfgogl/zonehunters/confogl.cfg @@ -7,7 +7,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "[Zone]Hunters v2.8.9" +confogl_addcvar l4d_ready_cfg_name "[Zone]Hunters v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zonehunters/confogl_off.cfg b/cfg/cfgogl/zonehunters/confogl_off.cfg index 1e61a90c9..ecdeca4bc 100644 --- a/cfg/cfgogl/zonehunters/confogl_off.cfg +++ b/cfg/cfgogl/zonehunters/confogl_off.cfg @@ -6,9 +6,6 @@ // https://github.com/SirPlease/L4D2-Competitive-Rework // ======================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -16,4 +13,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins \ No newline at end of file +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/zonehunters/confogl_plugins.cfg b/cfg/cfgogl/zonehunters/confogl_plugins.cfg index d01957ff2..2b76f2a77 100644 --- a/cfg/cfgogl/zonehunters/confogl_plugins.cfg +++ b/cfg/cfgogl/zonehunters/confogl_plugins.cfg @@ -6,6 +6,17 @@ // https://github.com/SirPlease/L4D2-Competitive-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // ZoneHunters Shared Plugins //------------------------------------------- @@ -14,8 +25,18 @@ exec cfgogl/zonehunters/shared_plugins.cfg //------------------------------------------- // ZoneHunters 4v4 //------------------------------------------- -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zonehunters/shared_cvars.cfg b/cfg/cfgogl/zonehunters/shared_cvars.cfg index 74cfcd10c..fe8af66fb 100644 --- a/cfg/cfgogl/zonehunters/shared_cvars.cfg +++ b/cfg/cfgogl/zonehunters/shared_cvars.cfg @@ -23,8 +23,7 @@ confogl_addcvar versus_marker_num 0 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled 1 - +confogl_addcvar l4d_ready_enabled 1 confogl_addcvar l4d_ready_survivor_freeze 0 confogl_addcvar l4d_ready_delay 3 confogl_addcvar l4d_ready_enable_sound 1 @@ -41,7 +40,7 @@ confogl_match_restart "1" // Sets whet // Confogl Cvars confogl_addcvar confogl_boss_tank "1" // Tank can't be prelit, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player -confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed +//confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed confogl_addcvar confogl_lock_boss_spawns "1" // Enables forcing same coordinates for tank and witch spawns (excluding tanks during finales) confogl_addcvar confogl_remove_escape_tank "1" // Removes tanks which spawn as the rescue vehicle arrives on finales confogl_addcvar confogl_disable_tank_hordes "1" // Disables natural hordes while tanks are in play diff --git a/cfg/cfgogl/zonehunters/shared_plugins.cfg b/cfg/cfgogl/zonehunters/shared_plugins.cfg index 1b99f490b..5569bc294 100644 --- a/cfg/cfgogl/zonehunters/shared_plugins.cfg +++ b/cfg/cfgogl/zonehunters/shared_plugins.cfg @@ -6,132 +6,116 @@ // https://github.com/SirPlease/L4D2-Competitive-Rework // ======================================================================================= -//------------------------ -// Sourcemod Basic Plugins -//------------------------ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx - //---------------------------------- // General Competitive Plugins //---------------------------------- -sm plugins load optional/l4d2_pickup.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx +sm_plugins_load optional/l4d2_pickup.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx //---------------------- // Equilibrium Plugins //---------------------- -sm plugins load optional/eq_finale_tanks.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d_tank_painfade.smx -sm plugins load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/eq_finale_tanks.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d_tank_painfade.smx +sm_plugins_load optional/l4d_texture_manager_block.smx //---------------------- // EQ3 / Acemod / ZoneMod //---------------------- -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_hunter_no_deadstops.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_tank_damage_cvars.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_hybrid_scoremod_zone.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/fix_engine.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/l4d2_melee_shenanigans.smx -sm plugins load optional/specrates.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/l4dhots.smx -sm plugins load optional/l4d2_ladder_rambos.smx -sm plugins load optional/l4d_tank_rush.smx -sm plugins load optional/noteam_nudging.smx -sm plugins load optional/l4d2_tank_horde_monitor.smx -sm plugins load optional/staggersolver.smx -sm plugins load optional/l4d_common_ragdolls_be_gone.smx -sm plugins load optional/l4d2_tankrage.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_hunter_no_deadstops.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_tank_damage_cvars.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_hybrid_scoremod_zone.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/fix_engine.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/l4d2_melee_shenanigans.smx +sm_plugins_load optional/specrates.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4dhots.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/l4d_tank_rush.smx +sm_plugins_load optional/noteam_nudging.smx +sm_plugins_load optional/l4d2_tank_horde_monitor.smx +sm_plugins_load optional/staggersolver.smx +sm_plugins_load optional/l4d_common_ragdolls_be_gone.smx +sm_plugins_load optional/l4d2_tankrage.smx //---------------------- // ZoneHunters //---------------------- -sm plugins load optional/l4d2_sniper_precache.smx -sm plugins load optional/l4d2_sniper_bodyshot.smx -sm plugins load optional/weapon_loadout_vote.smx +sm_plugins_load optional/l4d2_sniper_precache.smx +sm_plugins_load optional/l4d2_sniper_bodyshot.smx +sm_plugins_load optional/weapon_loadout_vote.smx //---------------------- // Static shotgun spread //---------------------- -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx //--------------------------------------------- // Merged FF Plugins, needs to be loaded here //--------------------------------------------- -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx //--------------------------- // Matchmaking Plugins //--------------------------- -sm plugins load optional/readyup.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/cfg_motd.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/spechud.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/witch_and_tankifier.smx - -// Letzzzz go. -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/cfg_motd.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/witch_and_tankifier.smx \ No newline at end of file diff --git a/cfg/cfgogl/zonemod/confogl.cfg b/cfg/cfgogl/zonemod/confogl.cfg index 7b4f2edb1..9102cb313 100644 --- a/cfg/cfgogl/zonemod/confogl.cfg +++ b/cfg/cfgogl/zonemod/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "ZoneMod v2.8.9" +confogl_addcvar l4d_ready_cfg_name "ZoneMod v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zonemod/confogl_off.cfg b/cfg/cfgogl/zonemod/confogl_off.cfg index fda0a2373..6b1da93b6 100644 --- a/cfg/cfgogl/zonemod/confogl_off.cfg +++ b/cfg/cfgogl/zonemod/confogl_off.cfg @@ -7,9 +7,6 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -17,4 +14,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins \ No newline at end of file +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/zonemod/confogl_plugins.cfg b/cfg/cfgogl/zonemod/confogl_plugins.cfg index f00755096..16350a5a0 100644 --- a/cfg/cfgogl/zonemod/confogl_plugins.cfg +++ b/cfg/cfgogl/zonemod/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // ZoneMod Shared Plugins //------------------------------------------- @@ -15,9 +26,19 @@ exec cfgogl/zonemod/shared_plugins.cfg //------------------------------------------- // ZoneMod 4v4 //------------------------------------------- -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx -sm plugins load optional/l4d2_tongue_timer.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx +sm_plugins_load optional/l4d2_tongue_timer.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zonemod/shared_cvars.cfg b/cfg/cfgogl/zonemod/shared_cvars.cfg index 079c40e95..1ec1979f4 100644 --- a/cfg/cfgogl/zonemod/shared_cvars.cfg +++ b/cfg/cfgogl/zonemod/shared_cvars.cfg @@ -24,8 +24,7 @@ confogl_addcvar versus_marker_num 0 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled 1 - +confogl_addcvar l4d_ready_enabled 1 confogl_addcvar l4d_ready_survivor_freeze 0 confogl_addcvar l4d_ready_delay 3 confogl_addcvar l4d_ready_enable_sound 1 @@ -42,7 +41,7 @@ confogl_match_restart "1" // Sets whet // Confogl Cvars confogl_addcvar confogl_boss_tank "1" // Tank can't be prelit, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player -confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed +//confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed confogl_addcvar confogl_lock_boss_spawns "1" // Enables forcing same coordinates for tank and witch spawns (excluding tanks during finales) confogl_addcvar confogl_remove_escape_tank "1" // Removes tanks which spawn as the rescue vehicle arrives on finales confogl_addcvar confogl_disable_tank_hordes "1" // Disables natural hordes while tanks are in play diff --git a/cfg/cfgogl/zonemod/shared_plugins.cfg b/cfg/cfgogl/zonemod/shared_plugins.cfg index 66c9ad9a2..e2564a9ce 100644 --- a/cfg/cfgogl/zonemod/shared_plugins.cfg +++ b/cfg/cfgogl/zonemod/shared_plugins.cfg @@ -7,137 +7,121 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= -//------------------------ -// Sourcemod Basic Plugins -//------------------------ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx - //---------------------------------- // General Competitive Plugins //---------------------------------- -sm plugins load optional/l4d2_pickup.smx -sm plugins load optional/blockheatseekingchargers.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_nospitterduringtank.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_unsilent_jockey.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d_jockey_ledgehang.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx +sm_plugins_load optional/l4d2_pickup.smx +sm_plugins_load optional/blockheatseekingchargers.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_nospitterduringtank.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_unsilent_jockey.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d_jockey_ledgehang.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx //---------------------- // Equilibrium Plugins //---------------------- -sm plugins load optional/eq_finale_tanks.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d2_spitblock.smx -sm plugins load optional/l4d2_uniform_spit.smx -sm plugins load optional/l4d_tank_painfade.smx -sm plugins load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/eq_finale_tanks.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d2_spitblock.smx +sm_plugins_load optional/l4d2_uniform_spit.smx +sm_plugins_load optional/l4d_tank_painfade.smx +sm_plugins_load optional/l4d_texture_manager_block.smx //---------------------- // EQ3 / Acemod / ZoneMod //---------------------- -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_hunter_no_deadstops.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/boomer_horde_equalizer_refactored.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_tank_damage_cvars.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_hybrid_scoremod_zone.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/fix_engine.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/l4d2_melee_shenanigans.smx -sm plugins load optional/specrates.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/l4d2_fix_spawn_order.smx -sm plugins load optional/l4dhots.smx -sm plugins load optional/l4d_tank_rush.smx -sm plugins load optional/l4d2_ladder_rambos.smx -sm plugins load optional/noteam_nudging.smx -sm plugins load optional/l4d2_tank_horde_monitor.smx -sm plugins load optional/charger_incap_damage.smx -sm plugins load optional/l4d2_steady_boost.smx -sm plugins load optional/staggersolver.smx -sm plugins load optional/l4d2_nobackjumps.smx -sm plugins load optional/l4d_common_ragdolls_be_gone.smx -sm plugins load optional/l4d2_tankrage.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_hunter_no_deadstops.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/boomer_horde_equalizer_refactored.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_tank_damage_cvars.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_hybrid_scoremod_zone.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/fix_engine.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/l4d2_melee_shenanigans.smx +sm_plugins_load optional/specrates.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/l4d2_fix_spawn_order.smx +sm_plugins_load optional/l4dhots.smx +sm_plugins_load optional/l4d_tank_rush.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/noteam_nudging.smx +sm_plugins_load optional/l4d2_tank_horde_monitor.smx +sm_plugins_load optional/charger_incap_damage.smx +sm_plugins_load optional/l4d2_steady_boost.smx +sm_plugins_load optional/staggersolver.smx +sm_plugins_load optional/l4d2_nobackjumps.smx +sm_plugins_load optional/l4d_common_ragdolls_be_gone.smx +sm_plugins_load optional/l4d2_tankrage.smx //---------------------- // Static shotgun spread //---------------------- -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx //--------------------------------------------- // Merged FF Plugins, needs to be loaded here //--------------------------------------------- -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx //--------------------------- // Matchmaking Plugins //--------------------------- -sm plugins load optional/readyup.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/cfg_motd.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/spechud.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/witch_and_tankifier.smx -sm plugins load optional/l4d2_magnum_incap.smx - -// Letzzzz go. -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx \ No newline at end of file +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/cfg_motd.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/witch_and_tankifier.smx +sm_plugins_load optional/l4d2_magnum_incap.smx \ No newline at end of file diff --git a/cfg/cfgogl/zoneretro/confogl.cfg b/cfg/cfgogl/zoneretro/confogl.cfg index 3add2de2d..732007c54 100644 --- a/cfg/cfgogl/zoneretro/confogl.cfg +++ b/cfg/cfgogl/zoneretro/confogl.cfg @@ -8,7 +8,7 @@ // ======================================================================================= // ReadyUp Cvars -l4d_ready_cfg_name "ZoneMod Retro v2.8.9" +confogl_addcvar l4d_ready_cfg_name "ZoneMod Retro v2.8.9" // Confogl Cvars confogl_addcvar mp_gamemode "versus" // Force Versus for the config. diff --git a/cfg/cfgogl/zoneretro/confogl_off.cfg b/cfg/cfgogl/zoneretro/confogl_off.cfg index b1e9ab008..a6bdd612d 100644 --- a/cfg/cfgogl/zoneretro/confogl_off.cfg +++ b/cfg/cfgogl/zoneretro/confogl_off.cfg @@ -7,9 +7,6 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= -// Disable ReadyUp -l4d_ready_enabled 0 - // Reset Default Common Limit, Static Spawns, and String Count reset_static_maps sm_resetstringcount @@ -17,4 +14,6 @@ sm_resetstringcount // Unlock Plugins and reload defaults confogl_resetclientcvars confogl_resetcvars -pred_unload_plugins \ No newline at end of file +sm_plugins_load_unlock +sm_plugins_unload_all +sm_plugins_refresh \ No newline at end of file diff --git a/cfg/cfgogl/zoneretro/confogl_plugins.cfg b/cfg/cfgogl/zoneretro/confogl_plugins.cfg index 0ce66eba6..6edce8685 100644 --- a/cfg/cfgogl/zoneretro/confogl_plugins.cfg +++ b/cfg/cfgogl/zoneretro/confogl_plugins.cfg @@ -7,6 +7,17 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= +//------------------------------------------- +// Prepare for Plugin Loading +//------------------------------------------- +sm_plugins_load_unlock +sm_plugins_unload_all + +//------------------------------------------- +// Load General Fixes +//------------------------------------------- +exec generalfixes.cfg + //------------------------------------------- // ZoneMod Retro Shared Plugins //------------------------------------------- @@ -15,9 +26,19 @@ exec cfgogl/zoneretro/shared_plugins.cfg //------------------------------------------- // ZoneMod Retro 4v4 //------------------------------------------- -sm plugins load optional/survivor_mvp.smx -sm plugins load optional/l4d2_antibaiter.smx -sm plugins load optional/l4d2_playstats.smx -sm plugins load optional/l4d2_skill_detect.smx -sm plugins load optional/autopause.smx -sm plugins load optional/l4d2_tongue_timer.smx +sm_plugins_load optional/survivor_mvp.smx +sm_plugins_load optional/l4d2_antibaiter.smx +sm_plugins_load optional/l4d2_playstats.smx +sm_plugins_load optional/l4d2_skill_detect.smx +sm_plugins_load optional/autopause.smx +sm_plugins_load optional/l4d2_tongue_timer.smx + +//------------------------------------------- +// Shared Plugins File +//------------------------------------------- +exec sharedplugins.cfg + +//------------------------------------------- +// Lock Plugins +//------------------------------------------- +sm_plugins_load_lock \ No newline at end of file diff --git a/cfg/cfgogl/zoneretro/shared_cvars.cfg b/cfg/cfgogl/zoneretro/shared_cvars.cfg index f5d4836d1..5a7147142 100644 --- a/cfg/cfgogl/zoneretro/shared_cvars.cfg +++ b/cfg/cfgogl/zoneretro/shared_cvars.cfg @@ -24,8 +24,7 @@ confogl_addcvar versus_marker_num 0 exec confogl_rates.cfg // ReadyUp Cvars -l4d_ready_enabled 1 - +confogl_addcvar l4d_ready_enabled 1 confogl_addcvar l4d_ready_survivor_freeze 0 confogl_addcvar l4d_ready_delay 3 confogl_addcvar l4d_ready_enable_sound 1 @@ -42,7 +41,7 @@ confogl_match_restart "1" // Sets whet // Confogl Cvars confogl_addcvar confogl_boss_tank "1" // Tank can't be prelit, frozen and ghost until player takes over, punch fix, and no rock throw for AI tank while waiting for player -confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed +//confogl_addcvar confogl_boss_unprohibit "0" // Enable bosses spawning on all maps, even through they normally aren't allowed confogl_addcvar confogl_lock_boss_spawns "1" // Enables forcing same coordinates for tank and witch spawns (excluding tanks during finales) confogl_addcvar confogl_remove_escape_tank "1" // Removes tanks which spawn as the rescue vehicle arrives on finales confogl_addcvar confogl_disable_tank_hordes "1" // Disables natural hordes while tanks are in play diff --git a/cfg/cfgogl/zoneretro/shared_plugins.cfg b/cfg/cfgogl/zoneretro/shared_plugins.cfg index 4437d4b1a..b7e8971aa 100644 --- a/cfg/cfgogl/zoneretro/shared_plugins.cfg +++ b/cfg/cfgogl/zoneretro/shared_plugins.cfg @@ -7,127 +7,111 @@ // http://github.com/SirPlease/L4D2-Comp-Rework // ======================================================================================= -//------------------------ -// Sourcemod Basic Plugins -//------------------------ -sm plugins load basebans.smx -sm plugins load basecommands.smx -sm plugins load basecomm.smx -sm plugins load admin-flatfile.smx -sm plugins load adminhelp.smx -sm plugins load adminmenu.smx -sm plugins load funcommands.smx -sm plugins load playercommands.smx - //---------------------------------- // General Competitive Plugins //---------------------------------- -sm plugins load optional/l4d2_pickup.smx -sm plugins load optional/blocktrolls.smx -sm plugins load optional/bossspawningfix.smx -sm plugins load optional/botpopstop.smx -sm plugins load optional/coinflip.smx -sm plugins load optional/current.smx -sm plugins load optional/finalefix.smx -sm plugins load optional/l4d2_ghost_warp.smx -sm plugins load optional/l4d2_blind_infected.smx -sm plugins load optional/l4d2_nobhaps.smx -sm plugins load optional/l4d2_saferoom_detect.smx -sm plugins load optional/l4d2_saferoom_item_remove.smx -sm plugins load optional/l4d2_setscores.smx -sm plugins load optional/l4d2_si_ffblock.smx -sm plugins load optional/l4d2_weaponrules.smx -sm plugins load optional/l4d_bash_kills.smx -sm plugins load optional/l4d_equalise_alarm_cars.smx -sm plugins load optional/l4d_pounceprotect.smx -sm plugins load optional/l4d_tank_damage_announce.smx -sm plugins load optional/l4d_thirdpersonshoulderblock.smx -sm plugins load optional/l4d_weapon_limits.smx -sm plugins load optional/lerpmonitor.smx -sm plugins load optional/nosaferoomkits.smx -sm plugins load optional/pill_passer.smx -sm plugins load optional/ratemonitor.smx -sm plugins load optional/rock_stumble_block.smx -sm plugins load optional/si_fire_immunity.smx -sm plugins load optional/smart_ai_rock.smx -sm plugins load optional/starting_items.smx -sm plugins load optional/teamflip.smx -sm plugins load optional/temphealthfix.smx +sm_plugins_load optional/l4d2_pickup.smx +sm_plugins_load optional/blocktrolls.smx +sm_plugins_load optional/bossspawningfix.smx +sm_plugins_load optional/botpopstop.smx +sm_plugins_load optional/coinflip.smx +sm_plugins_load optional/current.smx +sm_plugins_load optional/finalefix.smx +sm_plugins_load optional/l4d2_ghost_warp.smx +sm_plugins_load optional/l4d2_blind_infected.smx +sm_plugins_load optional/l4d2_nobhaps.smx +sm_plugins_load optional/l4d2_saferoom_detect.smx +sm_plugins_load optional/l4d2_saferoom_item_remove.smx +sm_plugins_load optional/l4d2_setscores.smx +sm_plugins_load optional/l4d2_si_ffblock.smx +sm_plugins_load optional/l4d2_weaponrules.smx +sm_plugins_load optional/l4d_bash_kills.smx +sm_plugins_load optional/l4d_equalise_alarm_cars.smx +sm_plugins_load optional/l4d_pounceprotect.smx +sm_plugins_load optional/l4d_tank_damage_announce.smx +sm_plugins_load optional/l4d_thirdpersonshoulderblock.smx +sm_plugins_load optional/l4d_weapon_limits.smx +sm_plugins_load optional/lerpmonitor.smx +sm_plugins_load optional/nosaferoomkits.smx +sm_plugins_load optional/pill_passer.smx +sm_plugins_load optional/ratemonitor.smx +sm_plugins_load optional/rock_stumble_block.smx +sm_plugins_load optional/si_fire_immunity.smx +sm_plugins_load optional/smart_ai_rock.smx +sm_plugins_load optional/starting_items.smx +sm_plugins_load optional/teamflip.smx +sm_plugins_load optional/temphealthfix.smx //---------------------- // Equilibrium Plugins //---------------------- -sm plugins load optional/eq_finale_tanks.smx -sm plugins load optional/l4d2_drop_secondary.smx -sm plugins load optional/l4d2_m2_control_eq.smx -sm plugins load optional/l4d2_nosecondchances.smx -sm plugins load optional/l4d2_si_staggers.smx -sm plugins load optional/l4d2_slowdown_control.smx -sm plugins load optional/l4d_tank_painfade.smx -sm plugins load optional/l4d_texture_manager_block.smx +sm_plugins_load optional/eq_finale_tanks.smx +sm_plugins_load optional/l4d2_drop_secondary.smx +sm_plugins_load optional/l4d2_m2_control_eq.smx +sm_plugins_load optional/l4d2_nosecondchances.smx +sm_plugins_load optional/l4d2_si_staggers.smx +sm_plugins_load optional/l4d2_slowdown_control.smx +sm_plugins_load optional/l4d_tank_painfade.smx +sm_plugins_load optional/l4d_texture_manager_block.smx //---------------------- // EQ3 / Acemod / ZoneMod //---------------------- -sm plugins load optional/l4d_tankpunchstuckfix.smx -sm plugins load optional/despawn_health.smx -sm plugins load optional/checkpoint-rage-control.smx -sm plugins load optional/l4d2_profitless_ai_tank.smx -sm plugins load optional/l4d2_hunter_no_deadstops.smx -sm plugins load optional/l4d2_tank_attack_control.smx -sm plugins load optional/l4d2_tank_announce.smx -sm plugins load optional/boomer_horde_equalizer.smx -sm plugins load optional/l4d2_bw_rock_hit.smx -sm plugins load optional/l4d2_tank_damage_cvars.smx -sm plugins load optional/l4d2_getup_slide_fix.smx -sm plugins load optional/l4d2_hybrid_scoremod_zone.smx -sm plugins load optional/l4d2_uncommon_blocker.smx -sm plugins load optional/fix_engine.smx -sm plugins load optional/l4d2_collision_adjustments.smx -sm plugins load optional/l4d2_stats.smx -sm plugins load optional/l4d2_melee_shenanigans.smx -sm plugins load optional/specrates.smx -sm plugins load optional/l4d2_fix_spawn_order.smx -sm plugins load optional/l4dhots.smx -sm plugins load optional/l4d_tank_rush.smx -sm plugins load optional/l4d2_ladder_rambos.smx -sm plugins load optional/l4d2_dominatorscontrol.smx -sm plugins load optional/noteam_nudging.smx -sm plugins load optional/l4d2_tank_horde_monitor.smx -sm plugins load optional/staggersolver.smx -sm plugins load optional/l4d_common_ragdolls_be_gone.smx -sm plugins load optional/l4d2_tankrage.smx +sm_plugins_load optional/l4d_tankpunchstuckfix.smx +sm_plugins_load optional/despawn_health.smx +sm_plugins_load optional/checkpoint-rage-control.smx +sm_plugins_load optional/l4d2_profitless_ai_tank.smx +sm_plugins_load optional/l4d2_hunter_no_deadstops.smx +sm_plugins_load optional/l4d2_tank_attack_control.smx +sm_plugins_load optional/l4d2_tank_announce.smx +sm_plugins_load optional/boomer_horde_equalizer.smx +sm_plugins_load optional/l4d2_bw_rock_hit.smx +sm_plugins_load optional/l4d2_tank_damage_cvars.smx +sm_plugins_load optional/l4d2_getup_slide_fix.smx +sm_plugins_load optional/l4d2_hybrid_scoremod_zone.smx +sm_plugins_load optional/l4d2_uncommon_blocker.smx +sm_plugins_load optional/fix_engine.smx +sm_plugins_load optional/l4d2_collision_adjustments.smx +sm_plugins_load optional/l4d2_stats.smx +sm_plugins_load optional/l4d2_melee_shenanigans.smx +sm_plugins_load optional/specrates.smx +sm_plugins_load optional/l4d2_fix_spawn_order.smx +sm_plugins_load optional/l4dhots.smx +sm_plugins_load optional/l4d_tank_rush.smx +sm_plugins_load optional/l4d2_ladder_rambos.smx +sm_plugins_load optional/l4d2_dominatorscontrol.smx +sm_plugins_load optional/noteam_nudging.smx +sm_plugins_load optional/l4d2_tank_horde_monitor.smx +sm_plugins_load optional/staggersolver.smx +sm_plugins_load optional/l4d_common_ragdolls_be_gone.smx +sm_plugins_load optional/l4d2_tankrage.smx //---------------------- // Static shotgun spread //---------------------- -sm plugins load optional/l4d2_weapon_attributes.smx -sm plugins load optional/l4d2_static_shotgun_spread.smx +sm_plugins_load optional/l4d2_weapon_attributes.smx +sm_plugins_load optional/l4d2_static_shotgun_spread.smx //--------------------------------------------- // Merged FF Plugins, needs to be loaded here //--------------------------------------------- -sm plugins load optional/l4d2_godframes_control_merge.smx -sm plugins load optional/l4d2_getup_fixes.smx -sm plugins load optional/l4d2_hittable_control.smx +sm_plugins_load optional/l4d2_godframes_control_merge.smx +sm_plugins_load optional/l4d2_getup_fixes.smx +sm_plugins_load optional/l4d2_hittable_control.smx //--------------------------- // Matchmaking Plugins //--------------------------- -sm plugins load optional/readyup.smx -sm plugins load optional/si_class_announce.smx -sm plugins load optional/l4d_tank_control_eq.smx -sm plugins load optional/cfg_motd.smx -sm plugins load optional/l4d_boss_percent.smx -sm plugins load optional/l4d_boss_vote.smx -sm plugins load optional/caster_system.smx -sm plugins load optional/caster_assister.smx -sm plugins load optional/pause.smx -sm plugins load optional/panel_text.smx -sm plugins load optional/spechud.smx -sm plugins load optional/slots_vote.smx -sm plugins load optional/witch_and_tankifier.smx - -// Letzzzz go. -sm plugins load confoglcompmod.smx -sm plugins load match_vote.smx \ No newline at end of file +sm_plugins_load optional/readyup.smx +sm_plugins_load optional/si_class_announce.smx +sm_plugins_load optional/l4d_tank_control_eq.smx +sm_plugins_load optional/cfg_motd.smx +sm_plugins_load optional/l4d_boss_percent.smx +sm_plugins_load optional/l4d_boss_vote.smx +sm_plugins_load optional/caster_system.smx +sm_plugins_load optional/caster_assister.smx +sm_plugins_load optional/pause.smx +sm_plugins_load optional/panel_text.smx +sm_plugins_load optional/spechud.smx +sm_plugins_load optional/slots_vote.smx +sm_plugins_load optional/witch_and_tankifier.smx \ No newline at end of file diff --git a/cfg/generalfixes.cfg b/cfg/generalfixes.cfg index 3eed43b02..0883e93df 100644 --- a/cfg/generalfixes.cfg +++ b/cfg/generalfixes.cfg @@ -1,68 +1,60 @@ -// Requirements -sm plugins load left4dhooks.smx -sm plugins load optional/l4d2lib.smx -sm plugins load optional/predictable_unloader.smx - // General Fixes. -sm plugins load fixes/bequiet.smx -sm plugins load fixes/l4d_skip_intro.smx -sm plugins load fixes/command_buffer.smx -sm plugins load fixes/TickrateFixes.smx -sm plugins load fixes/l4d2_pistol_delay.smx -sm plugins load fixes/l4d_votepoll_fix.smx -sm plugins load fixes/l4d2_lagcomp_manager.smx -sm plugins load fixes/l4d_console_spam.smx -sm plugins load fixes/l4d2_script_cmd_swap.smx -sm plugins load optional/playermanagement.smx -sm plugins load optional/l4d2_sound_manipulation.smx -sm plugins load fixes/frozen_tank_fix.smx -sm plugins load fixes/l4d2_melee_damage_control.smx -sm plugins load fixes/fix_fastmelee.smx -sm plugins load fixes/l4d2_jockeyed_ladder_fix.smx -sm plugins load fixes/l4d2_no_post_jockey_deadstops.smx -sm plugins load fixes/l4d2_jockey_jumpcap_patch.smx -sm plugins load optional/l4d2_tank_props_glow.smx -sm plugins load fixes/l4d2_shadow_removal.smx -sm plugins load fixes/l4d2_explosiondmg_prev.smx -sm plugins load fixes/l4d2_car_alarm_hittable_fix.smx -sm plugins load fixes/l4d2_ai_damagefix.smx -sm plugins load fixes/l4d2_ladderblock.smx -sm plugins load fixes/l4d_fix_deathfall_cam.smx -sm plugins load optional/nodeathcamskip.smx -sm plugins load l4d_pause_message.smx -sm plugins load fixes/l4d2_boomer_shenanigans.smx -sm plugins load fixes/sv_consistency_fix.smx -sm plugins load fixes/l4d2_hltv_crash_fix.smx -sm plugins load optional/l4d2_map_transitions.smx -sm plugins load fixes/l4d_checkpoint_rock_patch.smx -sm plugins load fixes/l4d_backjump_fix.smx -sm plugins load fixes/l4d2_ellis_hunter_bandaid_fix.smx -sm plugins load fixes/l4d2_boomer_ladder_fix.smx -sm plugins load fixes/l4d_tongue_bend_fix.smx -sm plugins load fixes/l4d2_spit_cooldown_frozen_fix.smx -sm plugins load fixes/l4d2_spit_spread_patch.smx -sm plugins load fixes/l4d_fix_punch_block.smx -sm plugins load fixes/l4d_fix_finale_breakable.smx -sm plugins load fixes/l4d2_fix_firsthit.smx -sm plugins load fixes/l4d2_rock_trace_unblock.smx -sm plugins load fixes/l4d_static_punch_getup.smx -sm plugins load fixes/annoyance_exploit_fixes.smx -sm plugins load fixes/l4d_fix_shove_duration.smx -sm plugins load fixes/l4d2_jockey_hitbox_fix.smx -sm plugins load fixes/l4d_consistent_escaperoute.smx -sm plugins load fixes/l4d2_fix_rocketjump.smx -sm plugins load fixes/l4d2_charge_target_fix.smx -sm plugins load fixes/l4d2_shove_fix.smx -sm plugins load fixes/l4d2_scripted_tank_stage_fix.smx -sm plugins load fixes/l4d_fix_saferoom_ghostspawn.smx -sm plugins load fixes/l4d_tongue_block_fix.smx -sm plugins load fixes/l4d2_fix_team_shuffle.smx -sm plugins load fixes/l4d_tongue_float_fix.smx -sm plugins load fixes/l4d2_sg552_zoom_fix.smx -sm plugins load fixes/l4d2_changelevel.smx -sm plugins load fixes/weapon_spawn_duplicate_fix.smx -sm plugins load fixes/l4d_fix_common_shove.smx -sm plugins load fixes/l4d2_null_cusercmd_fix.smx +sm_plugins_load fixes/bequiet.smx +sm_plugins_load fixes/l4d_skip_intro.smx +sm_plugins_load fixes/TickrateFixes.smx +sm_plugins_load fixes/l4d2_pistol_delay.smx +sm_plugins_load fixes/l4d_votepoll_fix.smx +sm_plugins_load fixes/l4d2_lagcomp_manager.smx +sm_plugins_load fixes/l4d_console_spam.smx +sm_plugins_load fixes/l4d2_script_cmd_swap.smx +sm_plugins_load optional/playermanagement.smx +sm_plugins_load optional/l4d2_sound_manipulation.smx +sm_plugins_load fixes/frozen_tank_fix.smx +sm_plugins_load fixes/l4d2_melee_damage_control.smx +sm_plugins_load fixes/fix_fastmelee.smx +sm_plugins_load fixes/l4d2_jockeyed_ladder_fix.smx +sm_plugins_load fixes/l4d2_no_post_jockey_deadstops.smx +sm_plugins_load fixes/l4d2_jockey_jumpcap_patch.smx +sm_plugins_load optional/l4d2_tank_props_glow.smx +sm_plugins_load fixes/l4d2_shadow_removal.smx +sm_plugins_load fixes/l4d2_explosiondmg_prev.smx +sm_plugins_load fixes/l4d2_car_alarm_hittable_fix.smx +sm_plugins_load fixes/l4d2_ai_damagefix.smx +sm_plugins_load fixes/l4d2_ladderblock.smx +sm_plugins_load fixes/l4d_fix_deathfall_cam.smx +sm_plugins_load optional/nodeathcamskip.smx +sm_plugins_load fixes/l4d2_boomer_shenanigans.smx +sm_plugins_load fixes/sv_consistency_fix.smx +sm_plugins_load fixes/l4d2_hltv_crash_fix.smx +sm_plugins_load optional/l4d2_map_transitions.smx +sm_plugins_load fixes/l4d_backjump_fix.smx +sm_plugins_load fixes/l4d2_ellis_hunter_bandaid_fix.smx +sm_plugins_load fixes/l4d2_boomer_ladder_fix.smx +sm_plugins_load fixes/l4d_tongue_bend_fix.smx +sm_plugins_load fixes/l4d2_spit_cooldown_frozen_fix.smx +sm_plugins_load fixes/l4d2_spit_spread_patch.smx +sm_plugins_load fixes/l4d_fix_punch_block.smx +sm_plugins_load fixes/l4d_fix_finale_breakable.smx +sm_plugins_load fixes/l4d2_fix_firsthit.smx +sm_plugins_load fixes/l4d2_rock_trace_unblock.smx +sm_plugins_load fixes/l4d_static_punch_getup.smx +sm_plugins_load fixes/annoyance_exploit_fixes.smx +sm_plugins_load fixes/l4d_fix_shove_duration.smx +sm_plugins_load fixes/l4d2_jockey_hitbox_fix.smx +sm_plugins_load fixes/l4d_consistent_escaperoute.smx +sm_plugins_load fixes/l4d2_fix_rocketjump.smx +sm_plugins_load fixes/l4d2_charge_target_fix.smx +sm_plugins_load fixes/l4d2_shove_fix.smx +sm_plugins_load fixes/l4d2_scripted_tank_stage_fix.smx +sm_plugins_load fixes/l4d_fix_saferoom_ghostspawn.smx +sm_plugins_load fixes/l4d_tongue_block_fix.smx +sm_plugins_load fixes/l4d2_fix_team_shuffle.smx +sm_plugins_load fixes/l4d_tongue_float_fix.smx +sm_plugins_load fixes/l4d2_sg552_zoom_fix.smx +sm_plugins_load fixes/l4d2_changelevel.smx +sm_plugins_load fixes/weapon_spawn_duplicate_fix.smx +sm_plugins_load fixes/l4d_fix_common_shove.smx +sm_plugins_load fixes/l4d2_null_cusercmd_fix.smx // Anti-Cheat. -sm plugins load anticheat/l4d2_noghostcheat.smx +sm_plugins_load anticheat/l4d2_noghostcheat.smx \ No newline at end of file diff --git a/cfg/server.cfg b/cfg/server.cfg index 20b185d2c..13692e04c 100644 --- a/cfg/server.cfg +++ b/cfg/server.cfg @@ -3,32 +3,32 @@ // [General] // ----------------------------------------------------------------------- -hostname "My Cool Server" // Hostname bit that won't change. +hostname "My Cool Server" // Hostname bit that won't change. rcon_password "WowYouKnowThePasswordHere" // Rcon password, used for remote access mostly. sv_steamgroup "13333337" sv_search_key "CompetitiveRework" -sv_steamgroup_exclusive "1" // If set, only members of Steam group will be able to join the server when it's empty, public people will be able to join the server only if it has players. +sv_steamgroup_exclusive "1" // If set, only members of Steam group will be able to join the server when it's empty, public people will be able to join the server only if it has players. // (Forcing the IP as a non-group member in lobby, or directly connecting always works) - + motdfile "mymotd.txt" // This ensures that Valve doesn't overwrite the MoTD every Update. [Edit this file instead of motd.txt, found in the same folder (/left4dead2)] hostfile "myhost.txt" // This ensures that Valve doesn't overwrite the Hostfile every Update. [Edit this file instead of host.txt, found in the same folder (/left4dead2)] // What .cfg files to load on Matchmode load (Plugins, nothing else) - Separate with ; -sm_cvar confogl_match_execcfg_plugins "generalfixes.cfg;confogl_plugins.cfg;sharedplugins.cfg" +// sm_cvar confogl_match_execcfg_plugins "generalfixes.cfg;confogl_plugins.cfg;sharedplugins.cfg" // [Other Neat Stuff] // ----------------------------------------------------------------------- sv_allow_lobby_connect_only "0" // If set to 1, players may only join this server from matchmaking lobby, may not connect directly. -// [File Consistency] -// ----------------------------------------------------------------------- +// [File Consistency] +// ----------------------------------------------------------------------- sv_consistency "1" // Whether the server enforces file consistency for critical files. sv_pure "2" // The server will force all client files to come from Steam and additional files matching the Server. sv_pure_kick_clients "1" // If set to 1, the server will kick clients with mismatching files. // [Logging] -// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- log on //Creates a logfile (on | off) sv_logecho 0 //default 0; Echo log information to the console. sv_logfile 1 //default 1; Log server information in the log file. @@ -38,7 +38,7 @@ sv_logflush 0 //default 0; Flush the log files to dis sv_logsdir logs //Folder in the game directory where server logs will be stored. // [Addon Disabler] -// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- // This Setting will disable/enable the Serverside Addon Disabler. // -1 = use addonconfig.cfg // 0 = Disable addons. @@ -54,7 +54,7 @@ sm_cvar sv_allow_wait_command 0 // - When using a different Tickrate, modify settings accordingly: // 1. Change 100000 to (Tickrate * 1000) for Rate and Splitpacket. // 2. Change 100 to (Tickrate) for Cmd and Update Rates. -// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- sm_cvar sv_minrate 100000 // Minimum value of rate. sm_cvar sv_maxrate 100000 // Maximum Value of rate. sm_cvar sv_minupdaterate 100 // Minimum Value of cl_updaterate. @@ -70,8 +70,9 @@ sm_cvar fps_max 0 // Forces the maximum amount of FP // Tickrate Fixes sm_cvar tick_door_speed 1.3 -// Slots (This prevents constant resetting of sv_maxplayers on map change) -sm_cvar mv_maxplayers 30 +// Slots // slots_vote.smx takes care of resetting back to set bellow values +sm_cvar sv_maxplayers 30 +sm_cvar sv_visiblemaxplayers 30 // Some tweaking sm_cvar mp_autoteambalance 0 // Prevents some shuffling. @@ -82,8 +83,8 @@ sm_cvar sv_forcepreload 1 // Pre-loading is always a good th sm_cvar sv_client_predict 1 // This is already set on clients, but force them to predict. sm_cvar sv_client_cmdrate_difference 0 // Remove the clamp. sm_cvar sv_max_queries_sec_global 10 -sm_cvar sv_max_queries_sec 3 +sm_cvar sv_max_queries_sec 3 sm_cvar sv_max_queries_window 10 -sm_cvar sv_player_stuck_tolerance 5 +sm_cvar sv_player_stuck_tolerance 5 sm_cvar sv_stats 0 // Don't need these. sm_cvar sv_clockcorrection_msecs 25 // This one makes laggy players have less of an advantage regarding hitbox (as the server normally compensates for 60msec, lowering it below 15 will make some players appear stuttery) \ No newline at end of file diff --git a/cfg/sharedplugins.cfg b/cfg/sharedplugins.cfg index f842a9b79..8b7ec1d38 100644 --- a/cfg/sharedplugins.cfg +++ b/cfg/sharedplugins.cfg @@ -1 +1,5 @@ -// Your Plugins here. \ No newline at end of file +// Your Plugins here. + +// Letzzzz go. +sm_plugins_load confoglcompmod.smx // Should be last loaded, so when we unload plugins confoglcompmod restores ConVars +sm_plugins_load match_vote.smx \ No newline at end of file