Jump to content

Ayuda con gui


Julian09123

Recommended Posts

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 
) 
  
  

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

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

Link to comment

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 ) 

Link to comment

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 ) 

Link to comment
  • Recently Browsing   0 members

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