manawydan Posted February 7, 2013 Share Posted February 7, 2013 criei uma gui com guieditor, mas ela fica visivel automaticamente.poderiam me ajudar a corrigir isso? obrigado addEventHandler("onClientResourceStart", resourceRoot, function() janela = guiCreateWindow(435, 201, 364, 397, "merchant gui by manawydan", false) guiWindowSetSizable(janela, false) guiSetAlpha(janela, 0.81) pistolaI = guiCreateStaticImage(9, 27, 64, 64, "images/pistol.png", false, janela) pistolaB = guiCreateButton(13, 97, 53, 41, "1000", false, janela) silencI = guiCreateStaticImage(90, 27, 64, 64, "images/silenced.png", false, janela) silencB = guiCreateButton(91, 95, 53, 41, "1200", false, janela) deadleI = guiCreateStaticImage(177, 27, 64, 64, "images/deagle.png", false, janela) deadleB = guiCreateButton(178, 95, 53, 41, "1550", false, janela) katanaI = guiCreateStaticImage(251, 27, 64, 64, "images/katana.png", false, janela) katanaB = guiCreateButton(256, 95, 53, 41, "2100", false, janela) uziI = guiCreateStaticImage(10, 159, 64, 64, "images/uzi.png", false, janela) uziB = guiCreateButton(12, 227, 56, 41, "1800", false, janela) tec9I = guiCreateStaticImage(90, 159, 64, 64, "images/tec9.png", false, janela) tec9B = guiCreateButton(94, 227, 56, 41, "1900", false, janela) mp5I = guiCreateStaticImage(168, 159, 64, 64, "images/mp5.png", false, janela) mp5B = guiCreateButton(178, 227, 56, 41, "2000", false, janela) serraI = guiCreateStaticImage(255, 159, 64, 64, "images/chainsaw.png", false, janela) serraB = guiCreateButton(256, 223, 56, 41, "800", false, janela) shotgunI = guiCreateStaticImage(10, 284, 64, 64, "images/shotgun.png", false, janela) shotgunB = guiCreateButton(10, 349, 56, 38, "2200", false, janela) spaz12I = guiCreateStaticImage(78, 285, 64, 64, "images/SPAZ-12.png", false, janela) spaz12B = guiCreateButton(84, 349, 56, 38, "2500", false, janela) canoserradoI = guiCreateStaticImage(160, 285, 64, 64, "images/sawnoff.png", false, janela) canoserradoB = guiCreateButton(160, 349, 56, 38, "2600", false, janela) m4I = guiCreateStaticImage(242, 285, 64, 64, "images/M4.png", false, janela) m4B = guiCreateButton(246, 349, 56, 38, "2300", false, janela) granadaI = guiCreateStaticImage(327, 37, 28, 42, "images/nade.png", false, janela) granadaB = guiCreateButton(319, 91, 36, 35, "300", false, janela) casseteteB = guiCreateButton(321, 223, 33, 35, "X", false, janela) extintorI = guiCreateStaticImage(324, 292, 31, 58, "images/fireextintor.png", false, janela) extintorB = guiCreateButton(321, 352, 33, 35, "50", false, janela) addEventHandler("onClientGUIClick", pistolaB, BuyWeapon) addEventHandler("onClientGUIClick", silencB, BuyWeapon) addEventHandler("onClientGUIClick", deadleB, BuyWeapon) addEventHandler("onClientGUIClick", katanaB, BuyWeapon) addEventHandler("onClientGUIClick", uziB, BuyWeapon) addEventHandler("onClientGUIClick", tec9B, BuyWeapon) addEventHandler("onClientGUIClick", mp5B, BuyWeapon) addEventHandler("onClientGUIClick", serraB, BuyWeapon) addEventHandler("onClientGUIClick", shotgunB, BuyWeapon) addEventHandler("onClientGUIClick", spaz12B, BuyWeapon) addEventHandler("onClientGUIClick", canoserradoB, BuyWeapon) addEventHandler("onClientGUIClick", m4B, BuyWeapon) addEventHandler("onClientGUIClick", granadaB, BuyWeapon) addEventHandler("onClientGUIClick", extintorB, BuyWeapon) addEventHandler("onClientGUIClick", casseteteB, BuyWeapon) txd = engineLoadTXD("34.txd", 34 ) engineImportTXD(txd, 34) dff = engineLoadDFF("34.dff", 34 ) engineReplaceModel(dff, 34) local marcador = createMarker (243.59648132324, 1858.0260009766, 13.084012985229, "cylinder", 2.5, 255, 10, 0, 170 ) setElementAlpha(marcador, 0) end ) addEvent ( "verShop", true ) addEventHandler ( "verShop", root, function ( ) guiSetVisible(janela, true) showCursor(true) end ) Link to comment
yMassai Posted February 8, 2013 Share Posted February 8, 2013 Me diga uma coisa, o que esta dando de errado e como você quer que funcione o script. Tente separar os eventos adequadamente. Por favor colabore, coloque todo os script, oque você esta fazendo com o evento "verShop"? Link to comment
DNL291 Posted February 8, 2013 Share Posted February 8, 2013 Use isso abaixo do código que criou a janela: guiSetVisible(janela, false) Link to comment
Stanley Sathler Posted February 8, 2013 Share Posted February 8, 2013 Tente separar os eventos adequadamente. Os eventos foram separados adequadamente, Ninguem. - @manawydan, não se esqueça de, na função buyWeapon(), usar uma condição (com a variável source, visto que para o evento onClientGUIClick o source é o GUI clicado) para verificar qual o botão clicado (e, assim, determinar qual arma será comprada). Link to comment
manawydan Posted February 8, 2013 Author Share Posted February 8, 2013 valeu pessoal com a ajuda de vcs consegui arruma a gui, vlw (desculpe estar incomodando, atualmente, to com pouco tempo pra estudar lua, ja q as aulas comecaram) muito obrigado Link to comment
Recommended Posts