Julian09123 Posted September 15, 2013 Posted September 15, 2013 Hola amigos quisiera hacer que cuando entre al sv no me aparezca nada y cuando aprete f4 me aparezca y de nuevo f4 desaparezca pero nose no me anda alguien me lo soluciona? GUIEditor = { button = {}, window = {}, } function ven() GUIEditor.window[1] = guiCreateWindow(208, 119, 339, 406, "", false) guiWindowSetSizable(GUIEditor.window[1], false) Bang = guiCreateButton(209, 206, 120, 36, "Bangarang", false) parar = guiCreateButton(427, 489, 120, 36, "Parar Musica", false) Rock = guiCreateButton(427, 206, 120, 36, "Rock n Roll", false) Cinema = guiCreateButton(209, 290, 120, 36, "Cinema", false) First = guiCreateButton(427, 290, 120, 36, "First of the year", false) Rep = guiCreateButton(209, 378, 120, 36, "Reptile", false) Get = guiCreateButton(427, 378, 120, 36, "Get Up!", false) dxDrawRectangle(209, 90, 337, 46, tocolor(255, 0, 0, 255), true) dxDrawText("Panel de Musica", 239, 92, 501, 129, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Skrillex:", 209, 155, 443, 196, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) end addEventHandler("onClientRender", root, ven ) 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 one() if source == Get then sonido = playSound("Musica/Get.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) function by() if source == Rep then sonido = playSound("Musica/Rep.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) function par() if source == parar then sonido = stopSound( sonido ) setSoundVolume(sonido, 0.0) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) function abrir() bindKey("F4", "down", function() if ven == false then guiSetVisible(ven, true) showCursor(true) ven = true else guiSetVisible(ven, false) showCursor(false) ven = false end end ) end addEventHandler("onClientResourceStart", root, abrir)
Atouk Posted September 15, 2013 Posted September 15, 2013 Proba ahí, perdona si esta muy desacomodado esque estoy en la tablet jaja GUIEditor = { button = {}, window = {}, } function ven() dxDrawRectangle(209, 90, 337, 46, tocolor(255, 0, 0, 255), true) dxDrawText("Panel de Musica", 239, 92, 501, 129, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Skrillex:", 209, 155, 443, 196, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) end addEventHandler("onClientRender", root, ven ) GUIEditor.window[1] = guiCreateWindow(208, 119, 339, 406, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false ) Bang = guiCreateButton(209, 206, 120, 36, "Bangarang", false) parar = guiCreateButton(427, 489, 120, 36, "Parar Musica", false) Rock = guiCreateButton(427, 206, 120, 36, "Rock n Roll", false) Cinema = guiCreateButton(209, 290, 120, 36, "Cinema", false) First = guiCreateButton(427, 290, 120, 36, "First of the year", false) Rep = guiCreateButton(209, 378, 120, 36, "Reptile", false) Get = guiCreateButton(427, 378, 120, 36, "Get Up!", false) 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 one() if source == Get then sonido = playSound("Musica/Get.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) function by() if source == Rep then sonido = playSound("Musica/Rep.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) function par() if source == parar then sonido = stopSound( sonido ) setSoundVolume(sonido, 0.0) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) function abrir() guiSetVisible(GUIEditor.window[1], true ) showCursor( true ) end bindKey("F4", "down", abrir )
EstrategiaGTA Posted September 15, 2013 Posted September 15, 2013 Usa guiSetVisible guiGetVisible if then showCursor bindKey "onClientResourceStart" El script de Atouk está mal: eso abrirá siempre el GUI cuando pulsas F4, por lo tanto puedes tener como 10000 windows abiertas.
AlvareZ_ Posted September 15, 2013 Posted September 15, 2013 GUIEditor = { button = {}, window = {}, } function ven() GUIEditor.window[1] = guiCreateWindow(208, 119, 339, 406, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) Bang = guiCreateButton(209, 206, 120, 36, "Bangarang", false) parar = guiCreateButton(427, 489, 120, 36, "Parar Musica", false) Rock = guiCreateButton(427, 206, 120, 36, "Rock n Roll", false) Cinema = guiCreateButton(209, 290, 120, 36, "Cinema", false) First = guiCreateButton(427, 290, 120, 36, "First of the year", false) Rep = guiCreateButton(209, 378, 120, 36, "Reptile", false) Get = guiCreateButton(427, 378, 120, 36, "Get Up!", false) dxDrawRectangle(209, 90, 337, 46, tocolor(255, 0, 0, 255), true) dxDrawText("Panel de Musica", 239, 92, 501, 129, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Skrillex:", 209, 155, 443, 196, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) end addEventHandler("onClientRender", root, ven ) 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 one() if source == Get then sonido = playSound("Musica/Get.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) function by() if source == Rep then sonido = playSound("Musica/Rep.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) function par() if source == parar then sonido = stopSound( sonido ) setSoundVolume(sonido, 0.0) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) bindKey("F4", "down", function() guiSetVisible (GUIEditor.window[1], not guiGetVisible ( GUIEditor.window[1] ) ) showCursor(true, not showCursor ( false ) ) end)
Alexs Posted September 15, 2013 Posted September 15, 2013 local visible = false local guiWidgets = { win = guiCreateWindow(208, 119, 339, 406, "", false), Bang = guiCreateButton(209, 206, 120, 36, "Bangarang", false), parar = guiCreateButton(427, 489, 120, 36, "Parar Musica", false), Rock = guiCreateButton(427, 206, 120, 36, "Rock n Roll", false), Cinema = guiCreateButton(209, 290, 120, 36, "Cinema", false), First = guiCreateButton(427, 290, 120, 36, "First of the year", false), Rep = guiCreateButton(209, 378, 120, 36, "Reptile", false), Get = guiCreateButton(427, 378, 120, 36, "Get Up!", false) } guiWindowSetSizable(guiWidgets.win, false) for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end function ven() dxDrawRectangle(209, 90, 337, 46, tocolor(255, 0, 0, 255), true) dxDrawText("Panel de Musica", 239, 92, 501, 129, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Skrillex:", 209, 155, 443, 196, tocolor(255, 255, 255, 255), 1, "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 one() if source == Get then sonido = playSound("Musica/Get.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) function by() if source == Rep then sonido = playSound("Musica/Rep.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) function par() if source == parar then sonido = stopSound( sonido ) setSoundVolume(sonido, 0.0) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) function abrir() bindKey("F4", "down", function() if not visible then then addEventHandler("onClientRender", root, ven ) for k, i in pairs( guiWidgets ) do guiSetVisible( i, true ) end else for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end removeEventHandler("onClientRender", root, ven ) end end ) end addEventHandler("onClientResourceStart", root, abrir)
Julian09123 Posted September 15, 2013 Author Posted September 15, 2013 (edited) Edit: Me habre pero no me cierra la ventana ni me muestra el cursor alex? Edited September 15, 2013 by Guest
GamerDeMTA Posted September 15, 2013 Posted September 15, 2013 (edited) creo que es que le puso local a la variable visible Edited September 15, 2013 by Guest
Alexs Posted September 15, 2013 Posted September 15, 2013 Perdón, me sobro un 'then'. local visible = false local guiWidgets = { win = guiCreateWindow(208, 119, 339, 406, "", false), Bang = guiCreateButton(209, 206, 120, 36, "Bangarang", false), parar = guiCreateButton(427, 489, 120, 36, "Parar Musica", false), Rock = guiCreateButton(427, 206, 120, 36, "Rock n Roll", false), Cinema = guiCreateButton(209, 290, 120, 36, "Cinema", false), First = guiCreateButton(427, 290, 120, 36, "First of the year", false), Rep = guiCreateButton(209, 378, 120, 36, "Reptile", false), Get = guiCreateButton(427, 378, 120, 36, "Get Up!", false) } guiWindowSetSizable(guiWidgets.win, false) for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end function ven() dxDrawRectangle(209, 90, 337, 46, tocolor(255, 0, 0, 255), true) dxDrawText("Panel de Musica", 239, 92, 501, 129, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Skrillex:", 209, 155, 443, 196, tocolor(255, 255, 255, 255), 1, "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 one() if source == Get then sonido = playSound("Musica/Get.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) function by() if source == Rep then sonido = playSound("Musica/Rep.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) function par() if source == parar then sonido = stopSound( sonido ) setSoundVolume(sonido, 0.0) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) function abrir() bindKey("F4", "down", function() if not visible then addEventHandler("onClientRender", root, ven ) for k, i in pairs( guiWidgets ) do guiSetVisible( i, true ) end else for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end removeEventHandler("onClientRender", root, ven ) end end ) end addEventHandler("onClientResourceStart", root, abrir)
Julian09123 Posted September 15, 2013 Author Posted September 15, 2013 Me habre pero no me cierra la ventana ni me muestra el cursor alex?
Alexs Posted September 15, 2013 Posted September 15, 2013 local visible = false local guiWidgets = { win = guiCreateWindow(208, 119, 339, 406, "", false), Bang = guiCreateButton(209, 206, 120, 36, "Bangarang", false), parar = guiCreateButton(427, 489, 120, 36, "Parar Musica", false), Rock = guiCreateButton(427, 206, 120, 36, "Rock n Roll", false), Cinema = guiCreateButton(209, 290, 120, 36, "Cinema", false), First = guiCreateButton(427, 290, 120, 36, "First of the year", false), Rep = guiCreateButton(209, 378, 120, 36, "Reptile", false), Get = guiCreateButton(427, 378, 120, 36, "Get Up!", false) } guiWindowSetSizable(guiWidgets.win, false) for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end function ven() dxDrawRectangle(209, 90, 337, 46, tocolor(255, 0, 0, 255), true) dxDrawText("Panel de Musica", 239, 92, 501, 129, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Skrillex:", 209, 155, 443, 196, tocolor(255, 255, 255, 255), 1, "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 one() if source == Get then sonido = playSound("Musica/Get.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) function by() if source == Rep then sonido = playSound("Musica/Rep.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) function par() if source == parar then sonido = stopSound( sonido ) setSoundVolume(sonido, 0.0) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) function abrir() bindKey("F4", "down", function() if not visible then addEventHandler("onClientRender", root, ven ) for k, i in pairs( guiWidgets ) do guiSetVisible( i, true ) end visible = true showCursor( true ) else for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end removeEventHandler("onClientRender", root, ven ) showCursor( false ) visible = false end end ) end addEventHandler("onClientResourceStart", root, abrir)
Julian09123 Posted September 15, 2013 Author Posted September 15, 2013 (edited) aver... Edited September 15, 2013 by Guest
Alexs Posted September 15, 2013 Posted September 15, 2013 Y Pero igual apreto f4 de nuevo y no se me cierra la ventana Copia mi ultimo código.
Julian09123 Posted September 15, 2013 Author Posted September 15, 2013 Y Pero igual apreto f4 de nuevo y no se me cierra la ventana Copia mi ultimo código. Listo pero ahora no anda la musica que paso?
Alexs Posted September 15, 2013 Posted September 15, 2013 local visible = false local guiWidgets = { win = guiCreateWindow(208, 119, 339, 406, "", false), Bang = guiCreateButton(209, 206, 120, 36, "Bangarang", false), parar = guiCreateButton(427, 489, 120, 36, "Parar Musica", false), Rock = guiCreateButton(427, 206, 120, 36, "Rock n Roll", false), Cinema = guiCreateButton(209, 290, 120, 36, "Cinema", false), First = guiCreateButton(427, 290, 120, 36, "First of the year", false), Rep = guiCreateButton(209, 378, 120, 36, "Reptile", false), Get = guiCreateButton(427, 378, 120, 36, "Get Up!", false) } guiWindowSetSizable(guiWidgets.win, false) for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end function ven() dxDrawRectangle(209, 90, 337, 46, tocolor(255, 0, 0, 255), true) dxDrawText("Panel de Musica", 239, 92, 501, 129, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Skrillex:", 209, 155, 443, 196, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) end function bangarang() if source == guiWidgets.Bang then sonido = playSound("Musica/Bang.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), bangarang ) function first() if source == guiWidgets.First then sonido = playSound("Musica/First.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), first ) function rock() if source == guiWidgets.Rock then sonido = playSound("Musica/Rock.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), rock ) function ci() if source == guiWidgets.Cinema then sonido = playSound("Musica/Cinema.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), ci ) function one() if source == guiWidgets.Get then sonido = playSound("Musica/Get.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) function by() if source == guiWidgets.Rep then sonido = playSound("Musica/Rep.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) function par() if source == guiWidgets.parar then sonido = stopSound( sonido ) setSoundVolume(sonido, 0.0) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) function abrir() bindKey("F4", "down", function() if not visible then addEventHandler("onClientRender", root, ven ) for k, i in pairs( guiWidgets ) do guiSetVisible( i, true ) end visible = true showCursor( true ) else for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end removeEventHandler("onClientRender", root, ven ) showCursor( false ) visible = false end end ) end addEventHandler("onClientResourceStart", root, abrir)
Julian09123 Posted September 15, 2013 Author Posted September 15, 2013 local visible = false local guiWidgets = { win = guiCreateWindow(208, 119, 339, 406, "", false), Bang = guiCreateButton(209, 206, 120, 36, "Bangarang", false), parar = guiCreateButton(427, 489, 120, 36, "Parar Musica", false), Rock = guiCreateButton(427, 206, 120, 36, "Rock n Roll", false), Cinema = guiCreateButton(209, 290, 120, 36, "Cinema", false), First = guiCreateButton(427, 290, 120, 36, "First of the year", false), Rep = guiCreateButton(209, 378, 120, 36, "Reptile", false), Get = guiCreateButton(427, 378, 120, 36, "Get Up!", false) } guiWindowSetSizable(guiWidgets.win, false) for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end function ven() dxDrawRectangle(209, 90, 337, 46, tocolor(255, 0, 0, 255), true) dxDrawText("Panel de Musica", 239, 92, 501, 129, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) dxDrawText("Skrillex:", 209, 155, 443, 196, tocolor(255, 255, 255, 255), 1, "bankgothic", "left", "top", false, false, true, false, false) end function bangarang() if source == guiWidgets.Bang then sonido = playSound("Musica/Bang.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), bangarang ) function first() if source == guiWidgets.First then sonido = playSound("Musica/First.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), first ) function rock() if source == guiWidgets.Rock then sonido = playSound("Musica/Rock.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), rock ) function ci() if source == guiWidgets.Cinema then sonido = playSound("Musica/Cinema.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), ci ) function one() if source == guiWidgets.Get then sonido = playSound("Musica/Get.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), one ) function by() if source == guiWidgets.Rep then sonido = playSound("Musica/Rep.mp3") setSoundVolume(sonido, 0.5) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), by ) function par() if source == guiWidgets.parar then sonido = stopSound( sonido ) setSoundVolume(sonido, 0.0) end end addEventHandler("onClientGUIClick", getResourceRootElement(getThisResource()), par ) function abrir() bindKey("F4", "down", function() if not visible then addEventHandler("onClientRender", root, ven ) for k, i in pairs( guiWidgets ) do guiSetVisible( i, true ) end visible = true showCursor( true ) else for k, i in pairs( guiWidgets ) do guiSetVisible( i, false ) end removeEventHandler("onClientRender", root, ven ) showCursor( false ) visible = false end end ) end addEventHandler("onClientResourceStart", root, abrir) Que era? que no andaba?
Alexs Posted September 15, 2013 Posted September 15, 2013 Primero creabas GUI's en cada frame, luego me sobro un 'then', luego olvide ir cambiando la variable 'visible' y por ultimo, había olvidado que pase todos los GUI a una tabla llamada 'guiWidgets'.
Julian09123 Posted September 15, 2013 Author Posted September 15, 2013 Gracias eres un genio y si puedes mira los MP te mande algo Gracias a todos.
Recommended Posts