Sticmy Posted July 3, 2015 Posted July 3, 2015 eh amigos bueno días, bueno no sé que eh echo mal pero esta función no me funciona lo que trato de hacer es poner un color desde una tabla, bueno espero sus respuestas. Codigo: addEventHandler("onClientResourceStart", resourceRoot, function() gui_spawn = guiCreateWindow(414, 178, 514, 379, "Sistema de Spawn.", false) guiWindowSetSizable(gui_spawn, false) guiSetVisible(gui_spawn, false) lista_spawn = guiCreateGridList(10, 25, 494, 298, false, gui_spawn) column = guiGridListAddColumn(lista_spawn, "Lista", 0.9) boton_spawn = guiCreateButton(147, 333, 217, 31, "Spawnear.", false, gui_spawn) guiSetFont(boton_spawn, "default-bold-small") local list = { {"test"}, {"test2"} } for index, y in ipairs(list) do local row = guiGridListAddRow(lista_spawn) guiGridListSetItemText(lista_spawn, row, 1, tostring(y[1]), false, true) guiGridListSetItemText(lista_spawn, row, 2, tostring(y[2]), false, true) guiGridListSetItemColor(lista_spawn, row, y[1], 0, 255, 0) end guiGridListSetSelectedItem(lista_spawn, 1, 1) end ) function panel_ver () showCursor( not isCursorShowing(gui_spawn) ) guiSetVisible (gui_spawn, not guiGetVisible ( gui_spawn ) ) end bindKey("f2", "down", panel_ver)
Tomas Posted July 3, 2015 Posted July 3, 2015 local dataTable = { { "texto", 255, 0, 0 }, { "texto", 0, 255, 0}, { "texto", 255, 255, 0}, { "texto", 255, 255, 255}, } for index , value in pairs ( dataTable ) do local row = guiGridListAddRow(lista_spawn) guiGridListSetItemText(lista_spawn, row, 1, value[1], false, true) guiGridListSetItemColor(lista_spawn, row, 1, value[2], value[3], value[4]) end
Recommended Posts