Soren Posted May 6, 2012 Posted May 6, 2012 Hola a todos, Tengo planeado hacer un map shop para mi proyecto secreto (pista: no es race!) necesito saber como meter todos los mapas a una lista osea un gui.
Castillo Posted May 7, 2012 Posted May 7, 2012 Busca los mapas compatibles con el game mode que estas creando.
Soren Posted May 7, 2012 Author Posted May 7, 2012 Busca los mapas compatibles con el game mode que estas creando. Perdona mi ignorancia, pero con que funciones hago eso?
Castillo Posted May 7, 2012 Posted May 7, 2012 function getServerMaps ( ) local resourceTable = getResources ( ) local mapsTable = { } for resourceKey, resourceValue in ipairs ( resourceTable ) do local name = getResourceInfo ( resourceValue, "name" ) local type = getResourceInfo ( resourceValue, "type" ) local game = getResourceInfo ( resourceValue, "gamemodes" ) if ( type == "map" and game == "tuGameMode" ) then table.insert ( mapsTable, { resName = getResourceName ( resourceValue ), name = name } ) end end return mapsTable end
Soren Posted May 7, 2012 Author Posted May 7, 2012 Como puedo meter ese codigo dentro de este gui que hice? quiero que salgan en el gridlist. Perdoname Solid no soy bueno con los guis. O cierto, como hago un buscador? se haria con string.find ? GUIEditor_Window = {} GUIEditor_Edit = {} GUIEditor_Grid = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(496,177,592,505,"TRD Map Store| By iSoren",false) GUIEditor_Grid[1] = guiCreateGridList(34,47,521,362,false,GUIEditor_Window[1]) guiGridListSetSelectionMode(GUIEditor_Grid[1],2) GUIEditor_Edit[1] = guiCreateEdit(56,433,295,28,"",false,GUIEditor_Window[1]) GUIEditor_Image[1] = guiCreateStaticImage(405,425,178,63,"images/shruk.png",false,GUIEditor_Window[1])
Castillo Posted May 7, 2012 Posted May 7, 2012 Ese script mio es server side, asi que vas a tener que usar triggers para enviar los datos al client side. Y para agregarlos a la grid list tenes que usar las siguientes funciones: guiGridListAddRow guiGridListSetItemText Para buscar si, necesitas usar string.find.
Recommended Posts