Скриптер
Проверенный
Пользователь
- Сообщения
- 3,566
- Реакции
- 1,560
- Помог
- 131 раз(а)
Ищу плагин или код, для блокировки звука, воспроизводимого при нажатии клавиши E.
/*
* Thanks to voed and f@ntom
*/
#include <amxmodx>
#include <reapi>
new HookChain:g_iHookChainStartSound;
public plugin_init()
{
register_plugin("Block WpnSelect Sound", "1.0", "w0w");
RegisterHookChain(RG_CBasePlayer_ImpulseCommands, "refwd_PlayerImpulseCommands_Pre");
RegisterHookChain(RG_CBasePlayer_ImpulseCommands, "refwd_PlayerImpulseCommands_Post", true);
DisableHookChain(g_iHookChainStartSound = RegisterHookChain(RH_SV_StartSound, "refwd_SV_StartSound_Pre", false));
}
public refwd_PlayerImpulseCommands_Pre(id)
{
if(get_member(id, m_afButtonPressed) & IN_USE)
EnableHookChain(g_iHookChainStartSound);
}
public refwd_PlayerImpulseCommands_Post(id)
{
DisableHookChain(g_iHookChainStartSound);
}
public refwd_SV_StartSound_Pre(const iRecipients, const iEntity, const iChannel, const szSample[], const flVolume, Float:flAttenuation, const fFlags, const iPitch)
{
if(contain(szSample, "wpn_denyselect") != -1 || contain(szSample, "wpn_select") != -1)
return HC_SUPERCEDE;
return HC_CONTINUE;
}