Jump to content

[APORTE] Sonidos diferentes a cada arma ( DayZ )


Recommended Posts

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
Link to comment
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

Link to comment
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 :)

Link to comment
  • Recently Browsing   0 members

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