diff --git a/StopSound/scripting/StopSound.sp b/StopSound/scripting/StopSound.sp index a133aa50..457754d8 100644 --- a/StopSound/scripting/StopSound.sp +++ b/StopSound/scripting/StopSound.sp @@ -202,7 +202,7 @@ public Action Command_StopMusic(int client, int args) { SetClientCookie(client, g_hCookieStopMapMusic, "1"); CReplyToCommand(client, "%t %t", "Chat Prefix", "Map music disabled"); - StopMapMusic(); + StopMapMusic(client); } else { @@ -283,7 +283,7 @@ void CheckMapMusicHooks() g_bStopMapMusicHooked = bShouldHook; } -void StopMapMusic() +void StopMapMusic(int client) { char sSound[PLATFORM_MAX_PATH]; char sEntity[16]; @@ -303,22 +303,11 @@ void StopMapMusic() g_MapMusic.GetString(sEntity, sSound, sizeof(sSound)); - StopSoundFromEntity(sSound, entity); + Client_StopSound(client, entity, SNDCHAN_STATIC, sSound); } delete MapMusicSnap; } -void StopSoundFromEntity(const char[] sSample, int entity) -{ - for(int i = 1; i <= MaxClients; i++) - { - if(g_bStopMapMusic[i] && IsClientInGame(i)) - { - Client_StopSound(i, entity, SNDCHAN_STATIC, sSample); - } - } -} - // I guess this is from SMLib void Client_StopSound(int client, int entity, int channel, const char[] name) { @@ -389,7 +378,7 @@ public int MenuHandler_StopSoundsSettings(Menu menu, MenuAction action, int clie { SetClientCookie(client, g_hCookieStopMapMusic, "1"); CPrintToChat(client, "%t %t", "Chat Prefix", "Map music disabled"); - StopMapMusic(); + StopMapMusic(client); } else {