Olá amigos! estou tentando criar uma grid para administrar os players, mas ele da um erro..
este aqui é o código:
function createPlayerList ()
playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true )
local column = guiGridListAddColumn( playerList, "Player", 0.85 )
if ( column ) then
for id, playeritem in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow ( playerList )
guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false )
end
addEventHandler ( "onClientGUIClick", playerList, click )
end
end
addEventHandler("onPlayerJoin", getRootElement(), createPlayerList)
function click ()
local playerName = guiGridListGetItemText ( playerList, guiGridListGetSelectedItem ( playerList ), 1 )
outputChatBox("Selecionei voce!", playerName)
end
Agradeço desde já!