I got work this way.
- Client itself EmitSound "Player.PickupWeapon" when "item_pickup" event trigger.
With this code you block event.
*edit
I found more sounds. When player pickup while running, it make sound.
PHP Code:
#include <sdktools>
public void OnPluginStart()
{
HookEvent("item_pickup", item_pickup, EventHookMode_Pre);
AddNormalSoundHook(soundhook);
}
public Action item_pickup(Event event, const char[] name, bool dontBroadcast)
{
return Plugin_Handled;
}
public Action soundhook(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(StrEqual(soundEntry, "Player.PickupWeapon", true) ||
StrEqual(soundEntry, "BaseCombatCharacter.AmmoPickup", true) ||
StrEqual(soundEntry, "Player.PickupGrenade", true))
{
return Plugin_Handled;
}
return Plugin_Continue;
}
__________________