0 Üye ve 1 Ziyaretçi konuyu incelemekte.
local sx,sy = guiGetScreenSize()local pg,pu = 200,200local x,y = (sx-pg)/2,(sy-pu)/2liste = guiCreateGridList(x,y,pg,pu,false)guiGridListAddColumn(liste,"col",0.95)for i=1,10 do local row = guiGridListAddRow(liste) guiGridListSetItemText(liste,row,1,"item "..i,false,false)endfunction seciliItem(gridList) local row,col = guiGridListGetSelectedItem(gridList) -- seçili item çek if row ~= -1 then -- eğer -1 den başka ise local yazi = guiGridListGetItemText(gridList,row,1) -- seçili itemin yazsını çek return yazi -- geri dönüşte gönder else return false endendaddEventHandler("onClientGUIDoubleClick", resourceRoot, function() if source == liste then -- eğer tıklanana elmenet liste ise local item = seciliItem(liste) -- seçili itemi çek if item then -- eğer item varsa if item == "item 5" then -- eğer item 5 ise --işlemler end end endend)
Kod: lualocal sx,sy = guiGetScreenSize()local pg,pu = 200,200local x,y = (sx-pg)/2,(sy-pu)/2liste = guiCreateGridList(x,y,pg,pu,false)guiGridListAddColumn(liste,"col",0.95)for i=1,10 do local row = guiGridListAddRow(liste) guiGridListSetItemText(liste,row,1,"item "..i,false,false)endfunction seciliItem(gridList) local row,col = guiGridListGetSelectedItem(gridList) -- seçili item çek if row ~= -1 then -- eğer -1 den başka ise local yazi = guiGridListGetItemText(gridList,row,1) -- seçili itemin yazsını çek return yazi -- geri dönüşte gönder else return false endendaddEventHandler("onClientGUIClick", resourceRoot, function() if source == liste then -- eğer tıklanana elmenet liste ise local item = seciliItem(liste) -- seçili itemi çek if item then -- eğer item varsa if item == "item 5" then -- eğer item 5 ise --işlemler end end endend)
local sx,sy = guiGetScreenSize()local pg,pu = 200,200local x,y = (sx-pg)/2,(sy-pu)/2liste = guiCreateGridList(x,y,pg,pu,false)guiGridListAddColumn(liste,"col",0.95)for i=1,10 do local row = guiGridListAddRow(liste) guiGridListSetItemText(liste,row,1,"item "..i,false,false)endfunction seciliItem(gridList) local row,col = guiGridListGetSelectedItem(gridList) -- seçili item çek if row ~= -1 then -- eğer -1 den başka ise local yazi = guiGridListGetItemText(gridList,row,1) -- seçili itemin yazsını çek return yazi -- geri dönüşte gönder else return false endendaddEventHandler("onClientGUIClick", resourceRoot, function() if source == liste then -- eğer tıklanana elmenet liste ise local item = seciliItem(liste) -- seçili itemi çek if item then -- eğer item varsa if item == "item 5" then -- eğer item 5 ise --işlemler end end endend)