Advertisement
ReverendV92

VOIP FX

Jul 9th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.53 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. print("VOIP FX - Military")
  4.  
  5. resource.AddFile( "jessev92/ui/cop_radio_on.wav" )
  6. util.PrecacheSound( "jessev92/ui/cop_radio_on.wav" )
  7. local chirpOn = Sound("jessev92/ui/cop_radio_on.wav")
  8.  
  9. resource.AddFile( "jessev92/ui/cop_radio_off.wav" )
  10. util.PrecacheSound( "jessev92/ui/cop_radio_off.wav" )
  11. --local chirpOff = Sound("jessev92/ui/cop_radio_off.wav")
  12. local chirpOff = Sound("jessev92/ui/cop_radio_on.wav")
  13.  
  14. local filterGround = Sound("BF2_Filter_Ground_Cut")
  15. local filterCommander = Sound("BF2_Filter_Commander_Cut")
  16. local filterVehicle = Sound("BF2_Filter_Vehicle_Cut")
  17. local filterPlane = Sound("BF2_Filter_Aircraft_Cut")
  18. local filterHeli = Sound("BF2_Filter_Helicopter_Cut")
  19.  
  20. sound.Add( {
  21. name        = "BF2_Filter_Ground",
  22. channel     = CHAN_STATIC,
  23. volume      = 1.0,
  24. level   = 0,
  25. //pitchstart    = 90,
  26. //pitchend  = 110,
  27. sound       = { "jessev92/bf2/filter/ground.wav"}
  28. } )
  29. util.PrecacheSound("jessev92/bf2/filter/ground.wav")
  30.  
  31. sound.Add( {
  32. name        = "BF2_Filter_Ground_Cut",
  33. channel     = CHAN_STATIC,
  34. volume      = 1.0,
  35. level   = 0,
  36. //pitchstart    = 90,
  37. //pitchend  = 110,
  38. sound       = { "jessev92/bf2/filter/ground_cut.wav"}
  39. } )
  40. util.PrecacheSound("jessev92/bf2/filter/ground_cut.wav")
  41.  
  42. sound.Add( {
  43. name        = "BF2_Filter_Commander",
  44. channel     = CHAN_STATIC,
  45. volume      = 1.0,
  46. level   = 0,
  47. //pitchstart    = 90,
  48. //pitchend  = 110,
  49. sound       = { "jessev92/bf2/filter/commander.wav"}
  50. } )
  51. util.PrecacheSound("jessev92/bf2/filter/commander.wav")
  52.  
  53. sound.Add( {
  54. name        = "BF2_Filter_Commander_Cut",
  55. channel     = CHAN_STATIC,
  56. volume      = 1.0,
  57. level   = 0,
  58. //pitchstart    = 90,
  59. //pitchend  = 110,
  60. sound       = { "jessev92/bf2/filter/commander_cut.wav"}
  61. } )
  62. util.PrecacheSound("jessev92/bf2/filter/commander_cut.wav")
  63.  
  64. sound.Add( {
  65. name        = "BF2_Filter_Vehicle",
  66. channel     = CHAN_STATIC,
  67. volume      = 1.0,
  68. level   = 0,
  69. //pitchstart    = 90,
  70. //pitchend  = 110,
  71. sound       = { "jessev92/bf2/filter/vehicle.wav"}
  72. } )
  73. util.PrecacheSound("jessev92/bf2/filter/vehicle.wav")
  74.  
  75. sound.Add( {
  76. name        = "BF2_Filter_Vehicle_Cut",
  77. channel     = CHAN_STATIC,
  78. volume      = 1.0,
  79. level   = 0,
  80. //pitchstart    = 90,
  81. //pitchend  = 110,
  82. sound       = { "jessev92/bf2/filter/vehicle_cut.wav"}
  83. } )
  84. util.PrecacheSound("jessev92/bf2/filter/vehicle_cut.wav")
  85.  
  86. sound.Add( {
  87. name        = "BF2_Filter_Aircraft",
  88. channel     = CHAN_STATIC,
  89. volume      = 1.0,
  90. level   = 0,
  91. //pitchstart    = 90,
  92. //pitchend  = 110,
  93. sound       = { "jessev92/bf2/filter/aircraft.wav"}
  94. } )
  95. util.PrecacheSound("jessev92/bf2/filter/aircraft.wav")
  96.  
  97. sound.Add( {
  98. name        = "BF2_Filter_Aircraft_Cut",
  99. channel     = CHAN_STATIC,
  100. volume      = 1.0,
  101. level   = 0,
  102. //pitchstart    = 90,
  103. //pitchend  = 110,
  104. sound       = { "jessev92/bf2/filter/aircraft_cut.wav"}
  105. } )
  106. util.PrecacheSound("jessev92/bf2/filter/aircraft_cut.wav")
  107.  
  108. sound.Add( {
  109. name        = "BF2_Filter_Helicopter",
  110. channel     = CHAN_STATIC,
  111. volume      = 1.0,
  112. level   = 0,
  113. //pitchstart    = 90,
  114. //pitchend  = 110,
  115. sound       = { "jessev92/bf2/filter/helicopter.wav"}
  116. } )
  117. util.PrecacheSound("jessev92/bf2/filter/helicopter.wav")
  118.  
  119. sound.Add( {
  120. name        = "BF2_Filter_Helicopter_Cut",
  121. channel     = CHAN_STATIC,
  122. volume      = 1.0,
  123. level   = 0,
  124. //pitchstart    = 90,
  125. //pitchend  = 110,
  126. sound       = { "jessev92/bf2/filter/helicopter_cut.wav"}
  127. } )
  128. util.PrecacheSound("jessev92/bf2/filter/helicopter_cut.wav")
  129.  
  130. local   heliFilterTable = { "wac_hc_206b",
  131.                             "wac_hc_206b_amphib",
  132.                             "wac_hc_ah1w",
  133.                             "wac_hc_ah1z",
  134.                             "wac_hc_ah64d_longbow",
  135.                             "wac_hc_blackhawk_uh60",
  136.                             "wac_hc_ch46_seaknight",
  137.                             "wac_hc_ch47_chinook",
  138.                             "wac_hc_ec655",
  139.                             "wac_hc_falcon",
  140.                             "wac_hc_hebullet",
  141.                             "wac_hc_hornet",
  142.                             "wac_hc_ka50",
  143.                             "wac_hc_littlebird_ah6",
  144.                             "wac_hc_littlebird_mh6",
  145.                             "wac_hc_mh53_pavelow",
  146.                             "wac_hc_mi17",
  147.                             "wac_hc_mi28_havoc",
  148.                             "wac_hc_mi35",
  149.                             "wac_hc_mm1_av8b",
  150.                             "wac_hc_mv22",
  151.                             "wac_hc_oh58_kiowa",
  152.                             "wac_hc_pelican",
  153.                             "wac_hc_r22",
  154.                             "wac_hc_rah66",
  155.                             "wac_hc_raven_oh23",
  156.                             "wac_hc_rocket",
  157.                             "wac_hc_s64",
  158.                             "wac_hc_uh1d",
  159.                             "wac_hc_uh1y_venom",
  160.                             "wac_hc_uh60lau61ca",
  161.                             "wac_v92_vdf_vc24",
  162.                             "wac_hc_*",
  163.                             "wac_hc_vdf_*",
  164.                             "wac_vdf_*",
  165.                             "wac_v92_*",
  166.                             "wac_v92_vdf_*",
  167.                             }
  168. local   jetFilterTable = {  "wac_pl_a6m2",
  169.                             "wac_pl_a10",
  170.                             "wac_pl_b17g",
  171.                             "wac_pl_bd5j",
  172.                             "wac_pl_bf109",
  173.                             "wac_pl_c130",
  174.                             "wac_pl_c172",
  175.                             "wac_pl_dh98",
  176.                             "wac_pl_f4",
  177.                             "wac_pl_f16",
  178.                             "wac_pl_f86",
  179.                             "wac_pl_fa18",
  180.                             "wac_pl_fw190",
  181.                             "wac_pl_hawx_fa22",
  182.                             "wac_pl_jenny",
  183.                             "wac_pl_ju87",
  184.                             "wac_pl_mm1_av8b",
  185.                             "wac_pl_p39",
  186.                             "wac_pl_p40",
  187.                             "wac_pl_p51",
  188.                             "wac_pl_sbu1",
  189.                             "wac_pl_spitfire",
  190.                             "wac_pl_t45",
  191.                             "wac_pl_ultralight",
  192.                             "wac_v92_vdf_a10",
  193.                             "wac_v92_vdf_c130",
  194.                             "wac_v92_vdf_f4",
  195.                             "wac_pl_*",
  196.                             "wac_pl_vdf_*",
  197.                             "wac_vdf_*",
  198.                             "wac_v92_*",
  199.                             "wac_v92_vdf_*",
  200.                             }
  201.  
  202. --if CLIENT then
  203.             --elseif (_C:InVehicle() and _C:GetVehicle() == heliFilterTable )           then
  204.             --elseif (_C:InVehicle() and _C:GetVehicle() == jetFilterTable )            then
  205.     local function PlayerStartVoice( _P )  
  206.         local _C = LocalPlayer()   
  207.         if ( _P:IsPlayer() and _P:Alive() ) then   
  208.             _C:EmitSound(chirpOn)
  209.             if _C:InVehicle() and _C:GetVehicle():GetClass():find("sent_sakarias_car_") then
  210.                 _C:EmitSound(filterVehicle)
  211.             elseif _C:InVehicle() and _C:GetVehicle().aircraft:GetClass():find("wac_hc_") then
  212.                 _C:EmitSound(filterHeli)
  213.             elseif _C:InVehicle() and _C:GetVehicle().aircraft:GetClass():find("wac_pl_") then
  214.                 _C:EmitSound(filterPlane)
  215.             elseif  _C:GetMoveType() == MOVETYPE_NOCLIP then
  216.                 _C:EmitSound(filterCommander)
  217.             else
  218.                 _C:EmitSound(filterGround)
  219.             end
  220.         end
  221.     end
  222.     hook.Add( "PlayerStartVoice", "PlayerStartedTheirVoiceCop", PlayerStartVoice)
  223.  
  224.     local function PlayerEndVoice( _P )
  225.         local _C = LocalPlayer()
  226.         if ( _P:IsPlayer() or !_P:Alive() ) then
  227.             _C:EmitSound(chirpOff)
  228.             if _C:InVehicle() and _C:GetVehicle():GetClass():find("sent_sakarias_car_") then
  229.                 _C:StopSound(filterVehicle)
  230.             elseif _C:InVehicle() and _C:GetVehicle().aircraft:GetClass():find("wac_hc_") then
  231.                 _C:StopSound(filterHeli)
  232.             elseif _C:InVehicle() and _C:GetVehicle().aircraft:GetClass():find("wac_pl_") then
  233.                 _C:StopSound(filterPlane)
  234.             elseif  (_C:GetMoveType() == MOVETYPE_NOCLIP) then
  235.                 _C:StopSound(filterCommander)
  236.             else
  237.                 _C:StopSound(filterGround)
  238.             end        
  239.         end
  240.     end      
  241.     hook.Add( "PlayerEndVoice", "PlayerEndedTheirVoiceCop", PlayerEndVoice)
  242. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement