FreeGells Posted February 5, 2013 Share Posted February 5, 2013 Olá amigos! estou tentando criar uma grid para administrar os players, mas ele da um erro.. [2013-02-05 13:05:08] ERROR: [DayZ-MTA]\DayZ\padmin.lua:2: attempt to call global 'guiCreateGridList' (a nil value) 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á! Link to comment
Anderl Posted February 5, 2013 Share Posted February 5, 2013 Mostre o ficheiro "meta.xml". Link to comment
DNL291 Posted February 5, 2013 Share Posted February 5, 2013 Você está usando o event 'onPlayerJoin' que é server-side com funções client-side, use 'onClientPlayerJoin'. No seu meta.xml o script pode estar como server-side, por isso esse erro no debug. Link to comment
FreeGells Posted February 5, 2013 Author Share Posted February 5, 2013 Olá, eu consegui abrir agora sem erros, mais quando entro no game, o GUI não aparece em minha tela, o que devo fazer ? Obrigado. Link to comment
Stanley Sathler Posted February 6, 2013 Share Posted February 6, 2013 Poste o atual código para que possamos ver qual o problema. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now