Jump to content

Help with sounds


BocTpuk

Recommended Posts

setWorldSoundEnabled(19, false)
setWorldSoundEnabled(24, false)

addEventHandler("onPlayerWeaponFire", root, function()
  local weapon = getPedWeapon(source)
  if weapon == 24 then
    playSound("sounds/m4fire.wav", false)
  elseif weapon == 24 then
    playSound("sounds/deaglefire.wav", false)
  end
end)

just an example for deagle and m4 sounds you can add the weapons you do like to replace 
 

Link to comment
1 hour ago, FLUSHBICEPS said:
setWorldSoundEnabled(19, false)
setWorldSoundEnabled(24, false)

addEventHandler("onPlayerWeaponFire", root, function()
  local weapon = getPedWeapon(source)
  if weapon == 24 then
    playSound("sounds/m4fire.wav", false)
  elseif weapon == 24 then
    playSound("sounds/deaglefire.wav", false)
  end
end)

just an example for deagle and m4 sounds you can add the weapons you do like to replace 
 

onPlayerWeaponFire is a server event 

use 

Link to comment
1 hour ago, alex17" said:

onPlayerWeaponFire is a server event 

use 

my fault I’ve made that quick asf xd

function onResourceStart()
  setWorldSoundEnabled(19, false)
  setWorldSoundEnabled(24, false)

  addEventHandler("onClientPlayerWeaponFire", localPlayer, function()
    local weapon = getPedWeapon(localPlayer)
    if weapon == 24 then
      playSound("sounds/m4fire.wav", false)
    elseif weapon == 24 then
      playSound("sounds/deaglefire.wav", false)
    end
  end)
end
addEventHandler("onClientResourceStart", resourceRoot, onResourceStart)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...