diff --git a/StopSound/scripting/StopSound.sp b/StopSound/scripting/StopSound.sp index 5d947c2..f6507d5 100644 --- a/StopSound/scripting/StopSound.sp +++ b/StopSound/scripting/StopSound.sp @@ -518,11 +518,23 @@ public Action Hook_NormalSound_CSS(int clients[MAXPLAYERS], int &numClients, cha return Plugin_Continue; } + int owner = entity; + if(owner > MaxClients) + { + char sClassname[64]; + if(GetEntityClassname(entity, sClassname, sizeof(sClassname))) + { + int projectile = StrContains(sClassname, "_projectile"); + if(projectile > 0 && projectile == strlen(sClassname) - strlen("_projectile")) // endswith + owner = GetEntPropEnt(entity, Prop_Send, "m_hThrower"); + } + } + int j = 0; for(int i = 0; i < numClients; i++) { int client = clients[i]; - if(!g_bStopWeaponSounds[client] && IsClientInGame(client)) + if(owner == client || (!g_bStopWeaponSounds[client] && IsClientInGame(client))) { // Keep client. clients[j] = clients[i];