diff --git a/README.md b/README.md index 3192b8ff..8037712e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ Including a records system, map zones (start/end marks etc), HUD with useful inf * [SourceMod 1.8 or above](http://www.sourcemod.net/downloads.php) # Optional requirements: -* `sv_disable_immunity_alpha` set to 1 in CS:GO for the `shavit_misc_playeropacity` setting to work. * [DHooks](http://users.alliedmods.net/~drifter/builds/dhooks/2.0/) - required for 250/260 runspeed for all weapons. * [Bunnyhop Statistics](https://forums.alliedmods.net/showthread.php?t=286135) - to show amount of scrolls for non-auto styles in the key display. CS:S only! * [SteamWorks](https://forums.alliedmods.net/showthread.php?t=229556) - for the `{serverip}` advertisement variable. diff --git a/scripting/shavit-misc.sp b/scripting/shavit-misc.sp index be2c43d3..968d1764 100644 --- a/scripting/shavit-misc.sp +++ b/scripting/shavit-misc.sp @@ -67,6 +67,7 @@ enum }; // cache +ConVar sv_disable_immunity_alpha; bool gB_Hide[MAXPLAYERS+1]; bool gB_Late = false; int gI_GroundEntity[MAXPLAYERS+1]; @@ -179,6 +180,7 @@ public void OnPluginStart() // cache gEV_Type = GetEngineVersion(); + sv_disable_immunity_alpha = FindConVar("sv_disable_immunity_alpha"); // spectator list RegConsoleCmd("sm_specs", Command_Specs, "Show a list of spectators."); @@ -438,6 +440,15 @@ public void OnConVarChanged(ConVar convar, const char[] oldValue, const char[] n gB_ClanTag = !StrEqual(gS_ClanTag, "0"); } +public void OnConfigsExecuted() +{ + if(sv_disable_immunity_alpha != null) + { + sv_disable_immunity_alpha.BoolValue = true; + delete sv_disable_immunity_alpha; + } +} + public void OnMapStart() { GetCurrentMap(gS_CurrentMap, 192);