~Funky~ Posted February 3, 2014 Share Posted February 3, 2014 Hola a todos tengo este problema, lo que pasa es que no me borra las label de la funcion que tengo D: aca el script : function Holi() Boton_1 = guiCreateButton(973, 537, 136, 34, "Jugadores VIP", false) guiSetAlpha(Boton_1, 0.83) Boton_2 = guiCreateButton(973, 581, 136, 34, "Anuncio", false) guiSetAlpha(Boton_2, 0.83) Boton_3 = guiCreateButton(973, 625, 136, 34, "Lugares", false) guiSetAlpha(Boton_3, 0.83) Label_15 = guiCreateLabel(968, 369, 213, 15, "Nombre:", false) guiSetFont(Label_15, "clear-normal") Label_16 = guiCreateLabel(968, 394, 213, 15, "Cuenta:", false) guiSetFont(Label_16, "clear-normal") Label_17 = guiCreateLabel(968, 419, 213, 15, "Dinero:", false) guiSetFont(Label_17, "clear-normal") Label_18 = guiCreateLabel(968, 444, 213, 15, "Nivel:", false) guiSetFont(Label_18, "clear-normal") Label_19 = guiCreateLabel(968, 469, 213, 15, "Respeto:", false) guiSetFont(Label_19, "clear-normal") Label_20 = guiCreateLabel(968, 494, 213, 15, "Rango VIP:", false) guiSetFont(Label_20, "clear-normal") Check_1 = guiCreateCheckBox(1122, 537, 151, 24, "Invisible", false, false) guiSetFont(Check_1, "clear-normal") Check_2 = guiCreateCheckBox(1122, 571, 151, 24, "Vehiculo Indestructible", false, false) guiSetFont(Check_2, "clear-normal") end state = false function abrir() if ( not state ) then Holi() setTimer(function () addEventHandler("onClientRender",root, HoliGRANDE)end,500,1) showCursor(true) state = true else state = false destroyElement ( Holi ) removeEventHandler("onClientRender",root, HoliGRANDE) showCursor(false) end end addCommandHandler("Holi", abrir) function HoliGRANDE() dxDrawRectangle(958, 264, 398, 425, tocolor(0, 0, 0, 134), false) dxDrawRectangle(958, 264, 398, 52, tocolor(0, 0, 0, 168), true) dxDrawText("Panel de Usuario VIP", 959, 264, 1356, 316, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, true, false, false) dxDrawText("General", 959, 316, 1065, 355, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "center", "center", false, false, true, false, false) dxDrawText("Vehiculos", 1065, 316, 1171, 355, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "center", "center", false, false, true, false, false) dxDrawText("Armas", 1171, 316, 1277, 355, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "center", "center", false, false, true, false, false) dxDrawText("Ayuda", 1277, 316, 1356, 355, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "center", "center", false, false, true, false, false) dxDrawLine(959, 316, 1357, 316, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(958, 316, 958, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(958, 355, 1356, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1065, 316, 1065, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1171, 316, 1171, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1277, 316, 1277, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1356, 316, 1356, 355, tocolor(255, 255, 255, 255), 1, true) end Link to comment
_SAXI_ Posted February 3, 2014 Share Posted February 3, 2014 Boton = {} Label = {} Check = {} function Holi() addCommandHandler("Holi", abrir) -- Así la función 'abrir' trabajará con los elementos de la función Holi Boton[1] = guiCreateButton(973, 537, 136, 34, "Jugadores VIP", false) guiSetAlpha(Boton[1], 0.83) Boton[2] = guiCreateButton(973, 581, 136, 34, "Anuncio", false) guiSetAlpha(Boton[2], 0.83) Boton[3]= guiCreateButton(973, 625, 136, 34, "Lugares", false) guiSetAlpha(Boton[3], 0.83) Label[15] = guiCreateLabel(968, 369, 213, 15, "Nombre:", false) guiSetFont(Label[15], "clear-normal") Label[16] = guiCreateLabel(968, 394, 213, 15, "Cuenta:", false) guiSetFont(Label[16], "clear-normal") Label[17] = guiCreateLabel(968, 419, 213, 15, "Dinero:", false) guiSetFont(Label[17], "clear-normal") Label[18] = guiCreateLabel(968, 444, 213, 15, "Nivel:", false) guiSetFont(Label[18], "clear-normal") Label[19] = guiCreateLabel(968, 469, 213, 15, "Respeto:", false) guiSetFont(Label[19], "clear-normal") Label[20] = guiCreateLabel(968, 494, 213, 15, "Rango VIP:", false) guiSetFont(Label[20], "clear-normal") Check[1] = guiCreateCheckBox(1122, 537, 151, 24, "Invisible", false, false) guiSetFont(Check[1], "clear-normal") Check[2] = guiCreateCheckBox(1122, 571, 151, 24, "Vehiculo Indestructible", false, false) guiSetFont(Check[2], "clear-normal") end state = false function abrir() if ( not state ) then Holi() setTimer(function () addEventHandler("onClientRender",root, HoliGRANDE)end,500,1) showCursor(true) state = true else state = false -- Crearemos un loop para cada elemento y así itineramos y eliminaremos los elementos de las tablas. for k,v in ipairs(Boton)do destroyElement(v) end for k,v in ipairs(Label)do destroyElement(v) end for k,v in ipairs(Check)do destroyElement(v) end removeEventHandler("onClientRender",root, HoliGRANDE) showCursor(false) end end function HoliGRANDE() dxDrawRectangle(958, 264, 398, 425, tocolor(0, 0, 0, 134), false) dxDrawRectangle(958, 264, 398, 52, tocolor(0, 0, 0, 168), true) dxDrawText("Panel de Usuario VIP", 959, 264, 1356, 316, tocolor(255, 255, 255, 255), 1.00, "bankgothic", "center", "center", false, false, true, false, false) dxDrawText("General", 959, 316, 1065, 355, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "center", "center", false, false, true, false, false) dxDrawText("Vehiculos", 1065, 316, 1171, 355, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "center", "center", false, false, true, false, false) dxDrawText("Armas", 1171, 316, 1277, 355, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "center", "center", false, false, true, false, false) dxDrawText("Ayuda", 1277, 316, 1356, 355, tocolor(255, 255, 255, 255), 0.50, "bankgothic", "center", "center", false, false, true, false, false) dxDrawLine(959, 316, 1357, 316, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(958, 316, 958, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(958, 355, 1356, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1065, 316, 1065, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1171, 316, 1171, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1277, 316, 1277, 355, tocolor(255, 255, 255, 255), 1, true) dxDrawLine(1356, 316, 1356, 355, tocolor(255, 255, 255, 255), 1, true) end Link to comment
~Funky~ Posted February 3, 2014 Author Share Posted February 3, 2014 em funciona todo pero no desaparecen los Labels D: EDIT: ahi si vale :3 Link to comment
Recommended Posts