Alexs Posted April 30, 2012 Share Posted April 30, 2012 Hola a Todos, mi problema es que ando creando un sistema de Spawn, la GUI y los botones funcionan, pero el segundo GUI, aparece cuando entras no cuando clickeas, el boton funciona al clickearlo aparece y desaparece, pero no comprendo por que el segundo GUI aparece cuando entras y el primero no. function categoria ( ) guiSetVisible ( WindowsCategoria, not guiGetVisible ( WindowsCategoria ) ) --Este funciona, y aparece cuando te loggeas showCursor ( guiGetVisible ( WindowsCategoria ) ) end addEvent( "spawnlogin", true ) addEventHandler( "spawnlogin", getRootElement(), categoria ) function zcboton ( ) guiSetVisible ( DefaultSpawn, not guiGetVisible ( DefaultSpawn ) ) --Este aparece cuando entras showCursor ( guiGetVisible ( DefaultSpawn ) ) guiSetVisible ( WindowsCategoria, false) end addEventHandler ( "onClientGUIClick", ButtonCatZC, zcboton, true ) Link to comment
iFoReX Posted April 30, 2012 Share Posted April 30, 2012 function categoria ( ) guiSetVisible(WindowsCategoria,true) showCursor(true) end addEvent( "spawnlogin", true ) addEventHandler( "spawnlogin", getRootElement(), categoria ) function zcboton ( ) if source == zcboton then guiSetVisible(DefaultSpawn,true) guiSetVisible(WindowsCategoria,false) showCursor(true) end addEventHandler ( "onClientGUIClick", root, zcboton ) listo creo Link to comment
Alexs Posted April 30, 2012 Author Share Posted April 30, 2012 Dice que el evento "spawnlogin" no esta agregado en ClientSide, y que me falta un "end" en la linea 31 Link to comment
iFoReX Posted April 30, 2012 Share Posted April 30, 2012 function categoria ( ) guiSetVisible(WindowsCategoria,true) showCursor(true) end addEvent( "spawnlogin", true ) addEventHandler( "spawnlogin", getLocalPlayer(), categoria ) function zcboton ( ) if source == zcboton then guiSetVisible(DefaultSpawn,true) guiSetVisible(WindowsCategoria,false) showCursor(true) end end addEventHandler ( "onClientGUIClick", root, zcboton ) proba ahora Link to comment
Alexs Posted April 30, 2012 Author Share Posted April 30, 2012 Ahora el boton no funciona y el problema sigue Link to comment
Alexs Posted April 30, 2012 Author Share Posted April 30, 2012 Client: GUIEditor_Label = {} WindowsCategoria = guiCreateWindow(63,60,701,484,"Elige una Categoria...",false) guiSetVisible ( WindowsCategoria, false ) GUIEditor_Label[1] = guiCreateLabel(383,123,5,5,"",false,WindowsCategoria) ButtonCatZC = guiCreateButton(52,70,251,290,"",false,WindowsCategoria) ImageZCCat = guiCreateStaticImage(24,26,208,237,"images/ZC-Grupo.png",false,ButtonCatZC) ButonClanesCat = guiCreateButton(385,70,251,290,"Clanes",false,WindowsCategoria) guiSetFont(ButonClanesCat,"sa-gothic") MemoZC1 = guiCreateMemo(41,383,269,75,"ZombieCity: Refugio Oficial.\nSi eres nuevo o no posees clan, entra aca, igual para los Miembros del Staff.",false,WindowsCategoria) guiMemoSetReadOnly(MemoZC1,true) MemoClanes1 = guiCreateMemo(376,383,269,75,"Clanes Oficiales:\n-[MCC]\n-|ALFA| ",false,WindowsCategoria) GUIEditor_Button = {} DefaultSpawn = guiCreateWindow(101,119,580,318,"Escoge un Spawn...",false) GUIEditor_Button[1] = guiCreateButton(41,46,211,242,"",false,DefaultSpawn) SpawnStaff = guiCreateButton(311,46,211,242,"Staff",false,DefaultSpawn) guiSetFont(SpawnStaff,"sa-gothic") ImagenDefaultSpwn = guiCreateStaticImage(54,65,187,213,"images/ZC-Grupo.png",false,DefaultSpawn) function categoria ( ) guiSetVisible(WindowsCategoria,true) showCursor(true) end addEvent( "spawnlogin", true ) addEventHandler( "spawnlogin", getLocalPlayer(), categoria ) function zcboton ( ) if source == zcboton then guiSetVisible(DefaultSpawn,true) guiSetVisible(WindowsCategoria,false) showCursor(true) end end addEventHandler ( "onClientGUIClick", root, zcboton ) Server: function categoriac ( ) triggerClientEvent ( source, "spawnlogin", source ) end addEventHandler ( "onPlayerLogin", getRootElement(), categoriac ) Link to comment
iFoReX Posted April 30, 2012 Share Posted April 30, 2012 Ya encontre el error chekea el codigo GUIEditor_Label = {} WindowsCategoria = guiCreateWindow(63,60,701,484,"Elige una Categoria...",false) guiSetVisible ( WindowsCategoria, false ) GUIEditor_Label[1] = guiCreateLabel(383,123,5,5,"",false,WindowsCategoria) ButtonCatZC = guiCreateButton(52,70,251,290,"",false,WindowsCategoria) ImageZCCat = guiCreateStaticImage(24,26,208,237,"images/ZC-Grupo.png",false,ButtonCatZC) ButonClanesCat = guiCreateButton(385,70,251,290,"Clanes",false,WindowsCategoria) guiSetFont(ButonClanesCat,"sa-gothic") MemoZC1 = guiCreateMemo(41,383,269,75,"ZombieCity: Refugio Oficial.\nSi eres nuevo o no posees clan, entra aca, igual para los Miembros del Staff.",false,WindowsCategoria) guiMemoSetReadOnly(MemoZC1,true) MemoClanes1 = guiCreateMemo(376,383,269,75,"Clanes Oficiales:\n-[MCC]\n-|ALFA| ",false,WindowsCategoria) GUIEditor_Button = {} DefaultSpawn = guiCreateWindow(101,119,580,318,"Escoge un Spawn...",false) GUIEditor_Button[1] = guiCreateButton(41,46,211,242,"",false,DefaultSpawn) SpawnStaff = guiCreateButton(311,46,211,242,"Staff",false,DefaultSpawn) guiSetFont(SpawnStaff,"sa-gothic") ImagenDefaultSpwn = guiCreateStaticImage(54,65,187,213,"images/ZC-Grupo.png",false,DefaultSpawn) guiSetVisible(WindowsCategoria,false) guiSetVisible(DefaultSpawn,false) showCursor(false) function categoria ( ) guiSetVisible(WindowsCategoria,true) showCursor(true) end addEvent( "spawnlogin", true ) addEventHandler( "spawnlogin", getLocalPlayer(), categoria ) function zcboton ( ) if source == ELBOTON then ----ai pones el boton yo le abia puesto el nombre de la function sory guiSetVisible(DefaultSpawn,true) guiSetVisible(WindowsCategoria,false) showCursor(true) end end addEventHandler ( "onClientGUIClick", root, zcboton ) Link to comment
Alexs Posted April 30, 2012 Author Share Posted April 30, 2012 Ya encontre el error chekea el codigo GUIEditor_Label = {} WindowsCategoria = guiCreateWindow(63,60,701,484,"Elige una Categoria...",false) guiSetVisible ( WindowsCategoria, false ) GUIEditor_Label[1] = guiCreateLabel(383,123,5,5,"",false,WindowsCategoria) ButtonCatZC = guiCreateButton(52,70,251,290,"",false,WindowsCategoria) ImageZCCat = guiCreateStaticImage(24,26,208,237,"images/ZC-Grupo.png",false,ButtonCatZC) ButonClanesCat = guiCreateButton(385,70,251,290,"Clanes",false,WindowsCategoria) guiSetFont(ButonClanesCat,"sa-gothic") MemoZC1 = guiCreateMemo(41,383,269,75,"ZombieCity: Refugio Oficial.\nSi eres nuevo o no posees clan, entra aca, igual para los Miembros del Staff.",false,WindowsCategoria) guiMemoSetReadOnly(MemoZC1,true) MemoClanes1 = guiCreateMemo(376,383,269,75,"Clanes Oficiales:\n-[MCC]\n-|ALFA| ",false,WindowsCategoria) GUIEditor_Button = {} DefaultSpawn = guiCreateWindow(101,119,580,318,"Escoge un Spawn...",false) GUIEditor_Button[1] = guiCreateButton(41,46,211,242,"",false,DefaultSpawn) SpawnStaff = guiCreateButton(311,46,211,242,"Staff",false,DefaultSpawn) guiSetFont(SpawnStaff,"sa-gothic") ImagenDefaultSpwn = guiCreateStaticImage(54,65,187,213,"images/ZC-Grupo.png",false,DefaultSpawn) guiSetVisible(WindowsCategoria,false) guiSetVisible(DefaultSpawn,false) showCursor(false) function categoria ( ) guiSetVisible(WindowsCategoria,true) showCursor(true) end addEvent( "spawnlogin", true ) addEventHandler( "spawnlogin", getLocalPlayer(), categoria ) function zcboton ( ) if source == ELBOTON then ----ai pones el boton yo le abia puesto el nombre de la function sory guiSetVisible(DefaultSpawn,true) guiSetVisible(WindowsCategoria,false) showCursor(true) end end addEventHandler ( "onClientGUIClick", root, zcboton ) Gracias funciona a la perfeccion, con esto ya tengo el comienzo a lo demas Link to comment
iFoReX Posted April 30, 2012 Share Posted April 30, 2012 genial espero averte ayudado alexs Link to comment
Alexs Posted April 30, 2012 Author Share Posted April 30, 2012 genial espero averte ayudado alexs Lo hiciste muchisimo :B Link to comment
Recommended Posts