HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <fakemeta>
  3.  
  4. new cvar_c4led, cvar_c4sound
  5.  
  6. new Trie:g_tSounds
  7.  
  8. new const UnPrecache_C4SoundList[][] =
  9. {
  10. "weapons/c4_click.wav",
  11. "weapons/c4_beep1.wav",
  12. "weapons/c4_beep2.wav",
  13. "weapons/c4_beep3.wav",
  14. "weapons/c4_beep4.wav",
  15. "weapons/c4_beep5.wav",
  16. "weapons/c4_plant.wav",
  17. "weapons/c4_disarm.wav",
  18. "weapons/c4_disarmed.wav"
  19. //"weapons/c4_explode1.wav"
  20. }
  21.  
  22. public plugin_init()
  23. {
  24. register_plugin("C4 Mute", "0.2", "RauliTop")
  25.  
  26. cvar_c4led = register_cvar("amx_blockc4led", "0")
  27. cvar_c4sound = register_cvar("amx_blockc4sound", "1")
  28.  
  29. if (get_pcvar_num(cvar_c4led))
  30. register_forward(FM_PrecacheModel, "fw_PrecacheModel")
  31.  
  32. if (get_pcvar_num(cvar_c4sound))
  33. {
  34. g_tSounds = TrieCreate( )
  35.  
  36. for( new i = 0; i < sizeof(UnPrecache_C4SoundList); i++ )
  37. TrieSetCell( g_tSounds, UnPrecache_C4SoundList[i], 1 )
  38.  
  39. register_forward(FM_PrecacheSound, "fw_PrecacheSound")
  40. }
  41. }
  42.  
  43. public fw_PrecacheModel(const szModel[])
  44. {
  45. if( equal(szModel, "sprites/ledglow.spr") != -1 )
  46. {
  47. // Block from being precached c4 led
  48. forward_return(FMV_CELL, 0)
  49. return FMRES_SUPERCEDE;
  50. }
  51.  
  52. return FMRES_IGNORED;
  53. }
  54.  
  55. public fw_PrecacheSound(const szSound[])
  56. {
  57. if( TrieKeyExists( g_tSounds, szSound ) )
  58. {
  59. // Block from being precached stuff again
  60. forward_return(FMV_CELL, 0)
  61. return FMRES_SUPERCEDE;
  62. }
  63.  
  64. return FMRES_IGNORED;
  65. }
  66. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  67. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
  68. */
  69.