Na halika.
Rikkóval ( RicoSanchez[/member] ) össze dobtam egy kódot, én elkezdtem, ő befejezte. :thumbsup:
Tessék <3 -- server side
local connection = dbConnect( \"mysql\", exports.core:getSQLData() )
addCommandHandler(\"azabizonyosparancs\", function (player)
teammates = {}
local query = dbQuery(connection,\"SELECT * FROM `acc` WHERE `teammate` >= 1 ORDER BY `acc`.`teammate` DESC\")
local result = dbPoll(query, -1)
local nick
if result then
for k, data in ipairs (result) do
nick = data[\"nick\"]
table.insert(teammates,{nick})
triggerClientEvent(player,\"listAllofTeamMateRender\", resourceRoot, teammates)
end
else
return
end
dbFree(query)
end)
--client side
local sx,sy = guiGetScreenSize ()
local width = 250
local height = 400
addEventHandler(\"onClientResourceStart\",resourceRoot, function()
window = guiCreateWindow (sx/2-width/2,sy/2-height/2,width,height,\"CSAPATHEHEHEHEHE\",false)
close = guiCreateButton (10,height-30,width-20,22,\"benyálazás\",false,window)
list = guiCreateGridList (10,25,width-20,height-60,false,window)
lel = guiGridlistddColumn (list,\"leeel\",0.35)
guiWindowSetMovable(window, false)
guiWindowSetSizable(window, false)
guiSetVisible(window, false)
addEventHandler (\"onClientGUIClick\", close, closeGui,false)
end)
function listAllofTeamMateRender(table)
guiSetVisible( window, true)
showCursor (true)
guiSetInputEnabled(true)
guiGridListClear(list)
for k,v in pairs(table) do
local row = guiGridlistddRow ( list )
guiGridListSetItemText ( list, row, lel, v[1], false, false )
end
end
addEvent(\"listAllofTeamMateRender\", true)
addEventHandler(\"listAllofTeamMateRender\", resourceRoot, listAllofTeamMateRender)
function closeGui(button, state)
if (button == \"left\") and (state == \"up\") then
guiSetVisible(window, false)
showCursor (false)
guiSetInputEnabled(false)
end
end