Jump to content

Ayuda para Colocar Sonido Motor


Daniel1zD

Recommended Posts

Estado tratando colocar un sonido en el auto como el de las armas pero yo lo quiero aselo con el el auto estoy usando funciones de remplazo como el de las armas no se si esto este bien por favor ayuda :c

function onClientPlayerWeaponFire ( infernus ) 
    local wX, wY, wZ = getPedWeaponMuzzlePosition ( getLocalPlayer() ) 
    if infernus == 411 then--id del auto 
        playSound3D ( "engine.mp3", false ) 
        setSoundMaxDistance(sound, 40) 
    end  
end 
  
addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), onClientPlayerWeaponFire ) 

Link to comment
function onClientPlayerWeaponFire ( infernus ) 
    modelo = getElementModel(infernus) 
    if modelo == 411 then--id del auto 
        x, y, z = getElementPosition(infernus) 
        sonido = playSound3D ( "engine.mp3", x, y, z true) 
        setSoundMaxDistance(sound, 40) 
        attachElements(sonido, infernus) 
    end 
end 
  
addEventHandler ( "onClientVehicleEnter", getRootElement(), onEngineOn ) 

Link to comment

no dio resultado no se oye nada muchas gracias por tu ayuda

function onClientPlayerWeaponFire ( infernus ) 
    modelo = getElementModel(infernus) 
    if modelo == 411 then--id del auto 
        x, y, z = getElementPosition(infernus) 
        sonido = playSound3D ( "engine.mp3", x, y, z true) 
        setSoundMaxDistance(sound, 100) 
        attachElements(sonido, infernus) 
    end 
end 
  
addEventHandler ( "onClientVehicleEnter", getRootElement(), onEngineOn ) 

ayuda con el remplaso de sonido del auto del motor

Link to comment

Seria algo asi o estoy mal en el guion ?

function onClientPlayerVehicleEnter ( infernus ) 
    local x,y,z = getElementPosition( getLocalPlayer() ) 
    if infernus == 411 then--id del auto 
        playSound3D ( "engine.mp3", false ) 
        setSoundMaxDistance(sound, 40) 
    end 
end 
  
addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), oonClientPlayerVehicleEnter ) 
  

Link to comment
Seria algo asi o estoy mal en el guion ?
function onClientPlayerVehicleEnter ( infernus ) 
    local x,y,z = getElementPosition( getLocalPlayer() ) 
    if infernus == 411 then--id del auto 
        playSound3D ( "engine.mp3", false ) 
        setSoundMaxDistance(sound, 40) 
    end 
end 
  
addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), oonClientPlayerVehicleEnter ) 
  

Está mal el playSound3D, esta funcion necesita coordenadas en donde reproducirse. Tu no agregas ninguna.

PD: es onClientPlayerVehicleEnter no oonClientPlayerVehicleEnter. Tienes una "O" de más.

Link to comment
function onClientPlayerVehicleEnter ( infernus ) 
    local x,y,z = getElementPosition( getLocalPlayer() ) 
    if infernus == 411 then--id del auto 
        sound = playSound3D( "engine.mp3",x, y, z false ) 
        setSoundMaxDistance(sound, 40) 
    end 
end 
  
addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), onClientPlayerVehicleEnter ) 

Sigue sin funcionar el guion :cry:

Link to comment
function onEngineOn ( infernus ) 
    modelo = getElementModel(infernus) 
    if modelo == 411 then--id del auto 
        x, y, z = getElementPosition(infernus) 
        sonido = playSound3D ( "engine.mp3", x, y, z true) 
        setSoundMaxDistance(sound, 40) 
        attachElements(sonido, infernus) 
    end 
end 
  
addEventHandler ( "onClientVehicleEnter", getRootElement(), onEngineOn ) 

Link to comment
  • Recently Browsing   0 members

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