Jump to content

Help over here


Baseplate

Recommended Posts

Well, kinda something is wrong here

local weapons = { 
        ["Samer"]=true,  
        ["Woods"]=true, 
        ["Thing"]=true, 
        ["Robbster"]=true 
        } 
  
GUIEditor_Window = {} 
GUIEditor_Label = {} 
GUIEditor_Grid = {} 
  
heroesWindow = guiCreateWindow(207,81,372,449,"Heroes List:",false) 
guiSetVisible(heroesWindow, false) 
GUIEditor_Label[1] = guiCreateLabel(2,21,5,15,"",false,heroesWindow) 
GUIEditor_Label[2] = guiCreateLabel(13,33,197,26,"This is our current Heroes List",false,heroesWindow) 
heroesGrid = guiCreateGridList(15,57,343,379,false,heroesWindow) 
guiGridListSetSelectionMode(heroesGrid,2) 
local heroesColumn = guiGridListAddColumn(heroesGrid,"Heroes",2) 
local row = guiGridListAddRow(heroesGrid) 
guiGridListSetItemText(heroesGrid,row,heroesColumn,tostring(weapons),false,false) 
addCommandHandler ("heroes",function() 
        if not guiGetVisible(heroesWindow) then 
                guiSetVisible(heroesWindow, true) 
                showCursor(true) 
        end 
end) 

Link to comment

You must loop the table to add each row.

local weapons = { 
        ["Samer"]=true, 
        ["Woods"]=true, 
        ["Thing"]=true, 
        ["Robbster"]=true 
        } 
  
GUIEditor_Window = {} 
GUIEditor_Label = {} 
GUIEditor_Grid = {} 
  
heroesWindow = guiCreateWindow(207,81,372,449,"Heroes List:",false) 
guiSetVisible(heroesWindow, false) 
GUIEditor_Label[1] = guiCreateLabel(2,21,5,15,"",false,heroesWindow) 
GUIEditor_Label[2] = guiCreateLabel(13,33,197,26,"This is our current Heroes List",false,heroesWindow) 
heroesGrid = guiCreateGridList(15,57,343,379,false,heroesWindow) 
guiGridListSetSelectionMode(heroesGrid,2) 
local heroesColumn = guiGridListAddColumn(heroesGrid,"Heroes",2) 
for member, _ in pairs ( weapons ) do 
    local row = guiGridListAddRow(heroesGrid) 
    guiGridListSetItemText(heroesGrid,row,heroesColumn,tostring(member),false,false) 
end 
addCommandHandler ("heroes",function() 
        if not guiGetVisible(heroesWindow) then 
                guiSetVisible(heroesWindow, true) 
                showCursor(true) 
        end 
end) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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