addEventHandler("onClientGUIClick", resourceRoot,
function()
if source == gridroom then
local row = guiGridListGetSelectedItem(gridroom)
local Text = guiGridListGetItemText(gridroom, row, clm)
if Text == "1" then
if isElement(grid4545) then destroyElement(grid4545) end
if isElement(gridplr3) then destroyElement(gridplr3) end
if isElement(gridplr2) then destroyElement(gridplr2) end
if isElement(gridplr4) then destroyElement(gridplr4) end
if isElement(gridplr5) then destroyElement(gridplr5) end
gridplr = guiCreateGridList(582, 60, 265, 240, false, teamspeak)
clmp = guiGridListAddColumn(gridplr, "Players ", 0.9)
for i,v in ipairs(getElementsByType("player")) do
if ( getElementData ( v,'data' ) == true ) then
local plrrom = guiGridListAddRow(gridplr)
guiGridListSetItemText(gridplr,plrrom,clmp,getPlayerName(v),false,false)
end
end
end
elseif Text == "2" then
if isElement(grid4545) then destroyElement(grid4545) end
if isElement(gridplr3) then destroyElement(gridplr3) end
if isElement(gridplr) then destroyElement(gridplr) end
if isElement(gridplr2) then destroyElement(gridplr2) end
if isElement(gridplr4) then destroyElement(gridplr4) end
if isElement(gridplr5) then destroyElement(gridplr5) end
gridplr2 = guiCreateGridList(582, 60, 265, 240, false, teamspeak)
clmp2 = guiGridListAddColumn(gridplr2, "Players ", 0.9)
for i,v in ipairs(getElementsByType("player")) do
if ( getElementData ( v,'data2' ) == true ) then
local plrrom2 = guiGridListAddRow(gridplr2)
guiGridListSetItemText(gridplr2,plrrom2,clmp2,getPlayerName(v),false,false)
end
end
elseif Text == "3" then
if isElement(grid4545) then destroyElement(grid4545) end
if isElement(gridplr) then destroyElement(gridplr) end
if isElement(gridplr2) then destroyElement(gridplr2) end
if isElement(gridplr4) then destroyElement(gridplr4) end
if isElement(gridplr5) then destroyElement(gridplr5) end
gridplr3 = guiCreateGridList(582, 60, 265, 240, false, teamspeak)
clmp3 = guiGridListAddColumn(gridplr3, "Players ", 0.9)
for i,v in ipairs(getElementsByType("player")) do
if ( getElementData ( v,'data3' ) == true ) then
local plrrom3 = guiGridListAddRow(gridplr3)
guiGridListSetItemText(gridplr3,plrrom3,clmp3,getPlayerName(v),false,false)
end
end
elseif Text == "4" then
if isElement(grid4545) then destroyElement(grid4545) end
if isElement(gridplr) then destroyElement(gridplr) end
if isElement(gridplr3) then destroyElement(gridplr3) end
if isElement(gridplr2) then destroyElement(gridplr2) end
if isElement(gridplr4) then destroyElement(gridplr4) end
if isElement(gridplr5) then destroyElement(gridplr5) end
gridplr4 = guiCreateGridList(582, 60, 265, 240, false, teamspeak)
clmp4 = guiGridListAddColumn(gridplr4, "Players ", 0.9)
for i,v in ipairs(getElementsByType("player")) do
if ( getElementData ( v,'data4' ) == true ) then
local plrrom4 = guiGridListAddRow(gridplr4)
guiGridListSetItemText(gridplr4,plrrom4,clmp4,getPlayerName(v),false,false)
end
end
elseif Text == "5" then
if isElement(grid4545) then destroyElement(grid4545) end
if isElement(gridplr) then destroyElement(gridplr) end
if isElement(gridplr3) then destroyElement(gridplr3) end
if isElement(gridplr2) then destroyElement(gridplr2) end
if isElement(gridplr4) then destroyElement(gridplr4) end
gridplr5 = guiCreateGridList(582, 60, 265, 240, false, teamspeak)
clmp5 = guiGridListAddColumn(gridplr5, "Players ", 0.9)
for i,v in ipairs(getElementsByType("player")) do
if ( getElementData ( v,'data5' ) == true ) then
local plrrom5 = guiGridListAddRow(gridplr5)
guiGridListSetItemText(gridplr5,plrrom5,clmp5,getPlayerName(v),false,false)
end
end
end
end
)