From 2114add6d51802bbf17449940e20cbb7e67366d7 Mon Sep 17 00:00:00 2001 From: Haze1337 Date: Tue, 23 Aug 2022 19:27:45 +0300 Subject: [PATCH] Fixes Fixed Hook "Shotgun Shot" for CS:GO. Changed the value "SNDPITCH_NORMAL" to 0 to fix fps lag. --- scripting/SoundManager.sp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripting/SoundManager.sp b/scripting/SoundManager.sp index 40b040e..62441b3 100644 --- a/scripting/SoundManager.sp +++ b/scripting/SoundManager.sp @@ -10,7 +10,7 @@ public Plugin myinfo = name = "Sound Manager", author = "Haze", description = "", - version = "1.0.2", + version = "1.0.3", url = "" } @@ -43,6 +43,8 @@ Handle gH_GetStringID = null; // Other int gI_SilentSoundScape = -1; int gI_AmbientOffset = 0; +char gS_WeaponID[32]; + bool gB_ShouldHookShotgunShot = false; ArrayList gA_LoopingAmbients = null; bool gB_EntitiesFound = false; @@ -62,10 +64,12 @@ public void OnPluginStart() if(gEV_Type == Engine_CSS) { gI_AmbientOffset = 85; + FormatEx(gS_WeaponID, sizeof(gS_WeaponID), "m_iWeaponID"); } else if(gEV_Type == Engine_CSGO) { gI_AmbientOffset = 89; + FormatEx(gS_WeaponID, sizeof(gS_WeaponID), "m_weapon"); } else { @@ -199,7 +203,7 @@ public Action OnPlayerRunCmd(int client) sSound = sSample; } - EmitSoundToClient(client, sSound, entity, SNDCHAN_STATIC, SNDLEVEL_NONE, SND_STOP, 0.0, SNDPITCH_NORMAL, _, _, _, true); + EmitSoundToClient(client, sSound, entity, SNDCHAN_STATIC, SNDLEVEL_NONE, SND_STOP, 0.0, 0, _, _, _, true); if(gI_Settings[client] & Debug) { @@ -656,7 +660,7 @@ public Action Hook_ShotgunShot(const char[] te_name, const int[] Players, int nu TE_WriteVector("m_vecOrigin", vTemp); TE_WriteFloat("m_vecAngles[0]", TE_ReadFloat("m_vecAngles[0]")); TE_WriteFloat("m_vecAngles[1]", TE_ReadFloat("m_vecAngles[1]")); - TE_WriteNum("m_iWeaponID", TE_ReadNum("m_iWeaponID")); + TE_WriteNum(gS_WeaponID, TE_ReadNum(gS_WeaponID)); TE_WriteNum("m_iMode", TE_ReadNum("m_iMode")); TE_WriteNum("m_iSeed", TE_ReadNum("m_iSeed")); TE_WriteNum("m_iPlayer", TE_ReadNum("m_iPlayer"));