Hero192 Posted September 2, 2015 Share Posted September 2, 2015 Hey guys, i want to get a number for each gridlist created and this number shows in the gridlist at the Column: "ID" i used the function guiGridListGetRowCount but i don't know how to use it in this situation.. please give me a hand local client = getLocalPlayer() window = guiCreateWindow(487,214,398,270,"Spawner",false) guiWindowSetSizable(window,false) guiSetVisible(window,false) grid = guiCreateGridList(9,21,380,212,false,window) guiGridListAddColumn(grid,"ID:",0.9) yes = guiCreateButton(28,238,148,23,"Spawn",false,window) no = guiCreateButton(224,238,148,23,"Close",false,window) addEvent("gui",true) addEventHandler("gui",root, function (Table) theMarker = marker guiSetVisible(window,true) showCursor(true) guiGridListClear(grid) for i,v in pairs(Table) do local row = guiGridListAddRow(grid) local guiGridListSetItemText(grid, row, 1, guiGridListGetRowCount(v), false, false) guiGridListSetItemText(grid, row, 2, getVehicleNameFromModel(v), false, false) end end) Link to comment
pa3ck Posted September 2, 2015 Share Posted September 2, 2015 guiGridListGetRowCount returns the number of rows, not the number of a specific row. If you want it to be like 1, 2, 3 etc why don't you use the table index? Link to comment
Hero192 Posted September 2, 2015 Author Share Posted September 2, 2015 I don't know how can you give me an example? Link to comment
TAPL Posted September 2, 2015 Share Posted September 2, 2015 local client = getLocalPlayer() window = guiCreateWindow(487,214,398,270,"Spawner",false) guiWindowSetSizable(window,false) guiSetVisible(window,false) grid = guiCreateGridList(9,21,380,212,false,window) guiGridListAddColumn(grid,"ID:",0.9) yes = guiCreateButton(28,238,148,23,"Spawn",false,window) no = guiCreateButton(224,238,148,23,"Close",false,window) addEvent("gui",true) addEventHandler("gui",root, function (Table) theMarker = marker guiSetVisible(window,true) showCursor(true) guiGridListClear(grid) for i,v in pairs(Table) do local row = guiGridListAddRow(grid) guiGridListSetItemText(grid, row, 1, i, false, false) guiGridListSetItemText(grid, row, 2, getVehicleNameFromModel(v), false, false) end end) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now