Jump to content

Como hacer para meter todos los mapas en una lista?


Soren

Recommended Posts

Posted

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.

Posted
Busca los mapas compatibles con el game mode que estas creando.

Perdona mi ignorancia, pero con que funciones hago eso?

Posted
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 

Posted

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]) 

Posted

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...