PHP Code:
public void OnPluginStart()
{
AddNormalSoundHook(NormalSound);
gCV_BhopSounds = new Convar("shavit_misc_bhopsounds", "0", "Should bhop (landing and jumping) sounds be muted?\n0 - Disabled\n1 - Blocked while !hide is enabled\n2 - Always blocked", 0, true, 0.0, true, 3.0);
}
public Action NormalSound(int clients[MAXPLAYERS], int &numClients, char sample[PLATFORM_MAX_PATH], int &entity, int &channel, float &volume, int &level, int &pitch, int &flags, char soundEntry[PLATFORM_MAX_PATH], int &seed)
{
if(!gCV_BhopSounds.BoolValue)
{
return Plugin_Continue;
}
if(StrContains(sample, "physics/") != -1 || StrContains(sample, "weapons/") != -1 || StrContains(sample, "player/") != -1 || StrContains(sample, "items/") != -1)
{
if(gCV_BhopSounds.IntValue == 2)
{
numClients = 0;
}
else
{
for(int i = 0; i < numClients; ++i)
{
if(IsValidClient(clients[i]) && gB_Hide[clients[i]])
{
for (int j = i; j < numClients-1; j++)
{
clients[j] = clients[j+1];
}
numClients--;
i--;
}
}
}
return Plugin_Changed;
}
return Plugin_Continue;
}
code from shavit