Jump to content

error sound


manawydan

Recommended Posts

Posted
function jedi(weaponID) 
  local muzzleX, muzzleY, muzzleZ = getPedWeaponMuzzlePosition(source) 
    local px, py, pz = getElementPosition ( source ) 
  
       if weaponID == 8 then  
            local sound = playSound3D("jedi.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
                end 
end 
addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), jedi ) 

what went wrong?

560x95_FFFFFF_09FF00_050505_000000.png

"Querer não é poder, mas tentar é avançar"!

Posted

What is the problem?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

The weapon ID 8 is a katana, onClientPlayerWeaponFire only works with weapons that can shot.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
function jedi(weaponID, Player) 
  local muzzleX, muzzleY, muzzleZ = getPedWeaponMuzzlePosition(Player) 
    local px, py, pz = getElementPosition ( Player ) 
  
       if weaponID == 8 and isControlEnabled ( player, "fire" ) then  
            local sound = playSound3D("jedi.mp3", muzzleX, muzzleY, muzzleZ, false) 
            setSoundMaxDistance(sound, 40) 
                end 
end 
addEventHandler ( "onClientResourceStart", getRootElement(), jedi ) 

this right? never used isControlEnabled

560x95_FFFFFF_09FF00_050505_000000.png

"Querer não é poder, mas tentar é avançar"!

Posted

I said onClientKey, not onClientResourceStart.

Try this:

function jedi ( ) 
    local muzzleX, muzzleY, muzzleZ = getPedWeaponMuzzlePosition ( localPlayer ) 
    local px, py, pz = getElementPosition ( localPlayer ) 
    local weaponID = getPedWeapon ( localPlayer ) 
    if ( weaponID == 8 and isControlEnabled ( "fire" ) ) then 
        local sound = playSound3D ( "jedi.mp3", muzzleX, muzzleY, muzzleZ, false ) 
        setSoundMaxDistance ( sound, 40 ) 
    end 
end 
bindKey ( "fire", "down", jedi ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're welcome.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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...