Hello, I have this code:
function click ( button, state, sx, sy, x, y, z, elem, gui )
local teamName
local menu
teamName = "spies"
menu = spiesMenu
primarySelection = getSelectedWeapon ( teamName, "primary" )
secondarySelection = getSelectedWeapon ( teamName, "secondary" )
throwableSelection = getSelectedWeapon ( teamName, "throwable" )
specialSection = getSelectedWeapon ( teamName, "special" )
if primarySelection then
outputChatBox ( primarySelection )
end
if secondarySelection then
outputChatBox ( secondarySelection )
end
end
function getSelectedWeapon ( teamName, category )
if teamName ~= "mercenaries" and teamName ~= "spies" then return false end
if retrieveGridList[teamName][category] == nil then return false end
local gridList = retrieveGridList[teamName][category]
local row = guiGridListGetSelectedItem ( gridList )
if row == -1 then return false end
selectedWeapon = guiGridListGetItemText ( gridList, row, 1 )
return selectedWeapon
end
and I have 4 gridlists in one GUI. How can I output just one selected item from one gridlist item I select? Now it outputs every item selected from each gridlist.