Jump to content

[APORTE] Sonidos diferentes a cada arma ( DayZ )


Recommended Posts

Posted (edited)

Aqui algo sencillo y bueno para poner diferentes sonidos a cada arma del DayZ.

table_f = { 
    {"Ballesta","file/Crossbow.wav","currentweapon_1",33}, 
    {"Bizon PP-19 SD","file/mp5.wav","currentweapon_2",29}, 
    --{WEAPON,FILE,CURRENT 1 OR 2, ID WEAPON} 
} 
  
max_distance = 10 
addEventHandler("onClientPlayerWeaponFire", root, 
function (weapon, _, _, _, _, _, _) 
        for _, v in pairs( table_f ) do 
            weapons, file, current, id = v[1],v[2],v[3],v[4] 
            if weapon == id then 
                if getElementData(getLocalPlayer(  ), current) == weapons then 
                    x,y,z = getPedWeaponMuzzlePosition( getLocalPlayer(  ) ) 
                    song = playSound3D( file, x,y,z, false ) 
                    setSoundMaxDistance(song, max_distance) 
                    setSoundVolume(song,3) 
                end 
            end 
        end 
    end 
) 

Algun bug avisan.

Edited by Guest
Posted
Y los sonidos?

x2

Tal vez él sólo quería compartir el script... no lo sé :roll:

Posted
Aqui algo sencillo y bueno para poner diferentes sonidos a cada arma del DayZ.
  
            if getElementData(getLocalPlayer(  ), "currentweapon_1") == weapon then 

Algun bug avisan.

yo que sepa ese script tuyo es para armas primarias , no para secundarias ya que el currentweapon varia

Posted
if getElementData(getLocalPlayer(  ), "currentweapon_1") == weapon or 
 getElementData(getLocalPlayer(  ), "currentweapon_2") == weapon or  
getElementData(getLocalPlayer(  ), "currentweapon_3") == weapon then 
  

asi no seria?

Posted

Yo que sepa las armas especiales( las 3eras ) son las granadas y bate y hacha, Apenas llegue a mi casa corrigió lo de que se escucha bajo el sonido del arma.

Posted
Cuando pongas algún recurso, podrías hacerlo bien y completo. Parece que vienes a poner un recurso que mal hecho está y luego todos terminan ayudandote por que el recurso está mal hecho. Si quieres que te ayuden con tus recursos, hacelo en la sección scripting.

Se aprende de los errores , Y como muchos buenos programadores aprender solo es mejor para saber como lo hicistes y demás.

Pero trataré de hacer las cosas mejor :)

Posted
if getElementData(getLocalPlayer(  ), "currentweapon_1") == weapon or 
 getElementData(getLocalPlayer(  ), "currentweapon_2") == weapon or  
getElementData(getLocalPlayer(  ), "currentweapon_3") == weapon then 
  

asi no seria?

No entiendo ésta parte, explícamela.

  • Recently Browsing   0 members

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