hlmod.hu
https://hlmod.hu/

ReAPI - Block WpnSelect Sound
https://hlmod.hu/viewtopic.php?f=134&t=29755
Oldal: 1 / 1

Szerző:  theglorious [ 2019.02.08. 16:27 ]
Hozzászólás témája:  ReAPI - Block WpnSelect Sound

ReAPI - Block WpnSelect Sound
Leírás:
  • Ez a plugin blokkolja a +use hangját (alapból E betű)
Cvar / Beállítás:
  • Nincs
Verzió:
  • v1.1
Követelmények:
  • ReApi
Kompatibilis:
  • Amx Mod X 1.8.3-1.9.0dev
Készítő:
  • w0w
  • fantom
Plugin:
  1. /*
  2. *   Thanks to voed and F@nt0M
  3. */
  4.  
  5. #include <amxmodx>
  6. #include <reapi>
  7.  
  8. new const g_szSoundSelect[] = "common/wpn_select.wav";
  9. new const g_szSoundDenySelect[] = "common/wpn_denyselect.wav";
  10.  
  11. new HookChain:g_iHookChainImpulseCommandsPost, HookChain:g_iHookChainStartSoundPre;
  12.  
  13. public plugin_init()
  14. {
  15.     register_plugin("Block WpnSelect Sound", "1.1", "w0w & F@nt0M");
  16.  
  17.     RegisterHookChain(RG_CBasePlayer_ImpulseCommands, "refwd_PlayerImpulseCommands_Pre", false);
  18.     DisableHookChain(g_iHookChainImpulseCommandsPost = RegisterHookChain(RG_CBasePlayer_ImpulseCommands, "refwd_PlayerImpulseCommands_Post", true));
  19.     DisableHookChain(g_iHookChainStartSoundPre = RegisterHookChain(RH_SV_StartSound, "refwd_SV_StartSound_Pre", false));
  20. }
  21.  
  22. public refwd_PlayerImpulseCommands_Pre(id)
  23. {
  24.     if(get_member(id, m_afButtonPressed) & IN_USE)
  25.     {
  26.         EnableHookChain(g_iHookChainImpulseCommandsPost);
  27.         EnableHookChain(g_iHookChainStartSoundPre);
  28.     }
  29. }
  30.  
  31. public refwd_PlayerImpulseCommands_Post(id)
  32. {
  33.     DisableHookChain(g_iHookChainImpulseCommandsPost);
  34.     DisableHookChain(g_iHookChainStartSoundPre);
  35. }
  36.  
  37. public refwd_SV_StartSound_Pre(const iRecipients, const iEntity, const iChannel, const szSample[], const flVolume, Float:flAttenuation, const fFlags, const iPitch)
  38. {
  39.     return strcmp(szSample, g_szSoundSelect) == 0 || strcmp(szSample, g_szSoundDenySelect) == 0 ? HC_SUPERCEDE : HC_CONTINUE;
  40. }

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/