diff --git a/plugins/SoundManager.smx b/plugins/SoundManager.smx index e5bca35..0bb1a94 100644 Binary files a/plugins/SoundManager.smx and b/plugins/SoundManager.smx differ diff --git a/scripting/SoundManager.sp b/scripting/SoundManager.sp index f4b9a9f..33a5345 100644 --- a/scripting/SoundManager.sp +++ b/scripting/SoundManager.sp @@ -14,9 +14,6 @@ public Plugin myinfo = url = "" } -//CSS: 138: port.LightHum2 -//CSGO: 199: port.LightHum2 - #define Mute_Soundscapes (1 << 0) #define Mute_AmbientSounds (1 << 1) #define Mute_GunSounds (1 << 2) @@ -43,6 +40,7 @@ Handle gH_GetPlayerSlot = null; // Other int gI_SilentSoundScape = 0; +int gI_AmbientOffset = 0; bool gB_ShouldHookShotgunShot = false; ArrayList gA_PlayEverywhereAmbients = null; bool gB_EntitiesFound = false; @@ -56,22 +54,26 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max gB_LateLoad = late; } +//CSS: 138: port.LightHum2 +//CSGO: 199: port.LightHum2 public void OnPluginStart() { gEV_Type = GetEngineVersion(); if(gEV_Type == Engine_CSS) { gI_SilentSoundScape = 138; + gI_AmbientOffset = 85; } else if(gEV_Type == Engine_CSGO) { gI_SilentSoundScape = 199; + gI_AmbientOffset = 89; } else { SetFailState("This plugin is only supported for CSS and CSGO."); } - + // Commands RegConsoleCmd("sm_snd", Command_Sounds); RegConsoleCmd("sm_sound", Command_Sounds); @@ -170,24 +172,24 @@ public Action OnPlayerRunCmd(int client) { return Plugin_Continue; } - + if(gI_Settings[client] & Mute_AmbientSounds == 0) { return Plugin_Continue; } - + if(gB_AlreadyMuted[client]) { return Plugin_Continue; } - + if(gEV_Type == Engine_CSS) { if(!gB_EntitiesFound) { return Plugin_Continue; } - + for(int i = 0; i < gA_PlayEverywhereAmbients.Length; i++) { int entity = EntRefToEntIndex(gA_PlayEverywhereAmbients.Get(i)); @@ -210,7 +212,7 @@ public Action OnPlayerRunCmd(int client) ClientCommand(client, "playgamesound Music.StopAllExceptMusic"); ClientCommand(client, "playgamesound Music.StopAllMusic"); } - + gB_AlreadyMuted[client] = true; return Plugin_Continue; @@ -416,16 +418,16 @@ public MRESReturn DHook_SendSound(Address pThis, Handle hParams) { return MRES_Ignored; } - + Address pIClient = pThis + view_as
(4); int client = view_as