manawydan Posted January 8, 2013 Posted January 8, 2013 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? "Querer não é poder, mas tentar é avançar"!
Castillo Posted January 8, 2013 Posted January 8, 2013 What is the problem? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manawydan Posted January 8, 2013 Author Posted January 8, 2013 the sound is not out "Querer não é poder, mas tentar é avançar"!
Castillo Posted January 8, 2013 Posted January 8, 2013 The weapon ID 8 is a katana, onClientPlayerWeaponFire only works with weapons that can shot. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manawydan Posted January 8, 2013 Author Posted January 8, 2013 has another function to be activated when a katana hit? I want to change the sound of it "Querer não é poder, mas tentar é avançar"!
Castillo Posted January 8, 2013 Posted January 8, 2013 You can do: onClientKey or bindKey isControlEnabled San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manawydan Posted January 8, 2013 Author Posted January 8, 2013 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 "Querer não é poder, mas tentar é avançar"!
Castillo Posted January 8, 2013 Posted January 8, 2013 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. Education is the most powerful weapon which you can use to change the world.
manawydan Posted January 8, 2013 Author Posted January 8, 2013 thank you very much. "Querer não é poder, mas tentar é avançar"!
Castillo Posted January 8, 2013 Posted January 8, 2013 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manawydan Posted January 8, 2013 Author Posted January 8, 2013 https://community.multitheftauto.com/ind ... ls&id=6277 thank you very much "Querer não é poder, mas tentar é avançar"!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now