Jump to content

Ayuda con gui


Julian09123

Recommended Posts

Posted

Hola amigos bueno como veran antes publique como hacer un panel music bueno no tube tiempo asique lo hare ahora.

Bueno quiero que cuando apretes el boton se repoduzca la cansion pero no intento hacer eso o nose como va ubicado el playSound

Anda pero al poner start desaparece el boton y se escucha la musica sin apretar nada

GUIEditor = { 
    button = {}, 
    window = {}, 
} 
    function pan() 
        GUIEditor.window[1] = guiCreateWindow(154, 123, 510, 420, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        Bang = guiCreateButton(154, 203, 114, 32, "Bangarang", playSound("Musica/Bang.mp3"), false) 
  
  
        First = guiCreateButton(286, 203, 114, 32, "First of the year", false) 
  
  
        Rock = guiCreateButton(547, 203, 114, 32, "Rock n roll", false) 
  
  
        Cinema = guiCreateButton(419, 203, 114, 32, "Cinema", false)   
        end 
addEventHandler("onClientResourceStart", resourceRoot, pan ) 
addEventHandler("onClientRender", root, 
    function() 
        dxDrawRectangle(154, 91, 509, 49, tocolor(255, 0, 0, 255), true) 
        dxDrawText("Panel de Musica -AR-", 221, 99, 625, 135, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) 
        dxDrawText("Skrillex:", 154, 154, 286, 185, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) 
    end 
) 
  
  

Skype: Juliang09123

Posted

Bien pero reemplazo onResourceStart por onClientGUIClick? y haci esto esta bien?

Bang = guiCreateButton(154, 203, 114, 32, "Bangarang", playSound("Musica/Bang.mp3"), false) 

Skype: Juliang09123

Posted

No, no remplazas nada. Y eso esta mal.

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
Entonces que hago? me explicas un poco mejor?

Creo que es así

GUIEditor = { 
    button = {}, 
    window = {}, 
} 
    function pan() 
        GUIEditor.window[1] = guiCreateWindow(154, 123, 510, 420, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
         
        Bang = guiCreateButton(154, 203, 114, 32, "Bangarang", false) 
  
  
        First = guiCreateButton(286, 203, 114, 32, "First of the year", false) 
  
  
        Rock = guiCreateButton(547, 203, 114, 32, "Rock n roll", false) 
  
  
        Cinema = guiCreateButton(419, 203, 114, 32, "Cinema", false)   
        end 
addEventHandler("onClientResourceStart", resourceRoot, pan ) 
addEventHandler("onClientRender", root, 
    function() 
        dxDrawRectangle(154, 91, 509, 49, tocolor(255, 0, 0, 255), true) 
        dxDrawText("Panel de Musica -AR-", 221, 99, 625, 135, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) 
        dxDrawText("Skrillex:", 154, 154, 286, 185, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) 
    end 
) 
  
function bangarang() 
    if source == Bang then 
        local sonido = playSound("Musica/Bang.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), bangarang) 

Jpccgao.jpg
Posted
Entonces que hago? me explicas un poco mejor?

Creo que es así

GUIEditor = { 
    button = {}, 
    window = {}, 
} 
    function pan() 
        GUIEditor.window[1] = guiCreateWindow(154, 123, 510, 420, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
         
        Bang = guiCreateButton(154, 203, 114, 32, "Bangarang", false) 
  
  
        First = guiCreateButton(286, 203, 114, 32, "First of the year", false) 
  
  
        Rock = guiCreateButton(547, 203, 114, 32, "Rock n roll", false) 
  
  
        Cinema = guiCreateButton(419, 203, 114, 32, "Cinema", false)   
        end 
addEventHandler("onClientResourceStart", resourceRoot, pan ) 
addEventHandler("onClientRender", root, 
    function() 
        dxDrawRectangle(154, 91, 509, 49, tocolor(255, 0, 0, 255), true) 
        dxDrawText("Panel de Musica -AR-", 221, 99, 625, 135, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) 
        dxDrawText("Skrillex:", 154, 154, 286, 185, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) 
    end 
) 
  
function bangarang() 
    if source == Bang then 
        local sonido = playSound("Musica/Bang.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), bangarang) 

Listo Gracias y te habia faltado el ) para cerrar el addEventHandler ya lo arregle gracias

Skype: Juliang09123

Posted

Tengo otro problema como hago para que cuando Pongas otra cansion osea apretar otro boton se pare la otra musica y la que apretaste empieze a escucharse? y tambien cree un boton de stopSound pero no anda

Esta mal?

function par() 
    if source == parar then 
        local sonido = stopSound( source ) 
        setSoundVolume(sonido, 0.0) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) 

Skype: Juliang09123

Posted

Quitale el "local" enfrente de sonido = playSound ( ) en el otro codigo, luego pone stopSound ( sonido ) en la funcion "par".

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
Quitale el "local" enfrente de sonido = playSound ( ) en el otro codigo, luego pone stopSound ( sonido ) en la funcion "par".

Me anda bien ahora hice todo pero cuando apreto a la ventana los botones como que se ponen detras de la ventana y no deja seleccionarlos mira

2i21pjn.jpg

Skype: Juliang09123

Posted

Pone los botones como parent de la ventana.

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
First = guiCreateButton(286, 203, 114, 32, "First of the year", false, GUIEditor.window[1]) 

Asi.

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

Debe ser porque creaste los botones con la posicion sin parent, tenes que moverlos.

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

Cambia la posicion, tan simple como eso.

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

Solid nose no puedo me faltan 3 botones que no aparecen

GUIEditor = { 
    button = {}, 
    window = {}, 
} 
    function pan() 
        GUIEditor.window[1] = guiCreateWindow(154, 123, 510, 420, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        Bang = guiCreateButton(10, 73, 114, 32, "Bangarang", false, GUIEditor.window[1]) 
        First = guiCreateButton(146, 73, 114, 32, "First of the year", false, GUIEditor.window[1]) 
        Rock = guiCreateButton(547, 203, 0, 32, "Rock n roll", false, GUIEditor.window[1]) 
        Cinema = guiCreateButton(284, 73, 92, 32, "Cinema", false, GUIEditor.window[1]) 
        End = guiCreateButton(10, 164, 118, 31, "In The End", false, GUIEditor.window[1]) 
        One = guiCreateButton(146, 164, 118, 31, "One step closer", false, GUIEditor.window[1]) 
        New = guiCreateButton(285, 164, 91, 31, "New Divide", false, GUIEditor.window[1]) 
        My = guiCreateButton(546, 286, 0, 31, "By Myself", false, GUIEditor.window[1]) 
        parar = guiCreateButton(574, 512, 0, 0, "Parar Musica", false, GUIEditor.window[1])    
         
    end          
addEventHandler("onClientResourceStart", resourceRoot, pan ) 
addEventHandler("onClientRender", root, 
    function() 
        dxDrawRectangle(154, 91, 509, 49, tocolor(255, 0, 0, 255), true) 
        dxDrawText("Panel de Musica -AR-", 221, 99, 625, 135, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) 
        dxDrawText("Skrillex:", 154, 154, 286, 185, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) 
        dxDrawText("Linkin Park:", 152, 246, 654, 277, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "left", "top", false, false, true, false, false) 
    end 
) 
  
function bangarang() 
    if source == Bang then 
        sonido = playSound("Musica/Bang.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), bangarang ) 
function first() 
    if source == First then 
        sonido = playSound("Musica/First.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), first ) 
function rock() 
    if source == Rock then 
        sonido = playSound("Musica/Rock.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), rock ) 
function ci() 
    if source == Cinema then 
        sonido = playSound("Musica/Cinema.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), ci ) 
function inthe() 
    if source == End then 
        sonido = playSound("Musica/End.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), inthe ) 
function one() 
    if source == One then 
        sonido = playSound("Musica/One.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) 
function by() 
    if source == My then 
         sonido = playSound("Musica/My.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) 
function nue() 
    if source == New then 
        sonido = playSound("Musica/New.mp3") 
        setSoundVolume(sonido, 0.5) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), nue ) 
function par() 
    if source == parar then 
        sonido = stopSound( sonido ) 
        setSoundVolume(sonido, 0.0) 
    end 
end 
addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) 

Skype: Juliang09123

  • Recently Browsing   0 members

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