FreeGells Posted February 5, 2013 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á!
Anderl Posted February 5, 2013 Posted February 5, 2013 Mostre o ficheiro "meta.xml". "[...] If you don’t love it, if you’re not having fun doing it, you don’t really love it, you’re going to give up." - Steve Jobs, 2007
DNL291 Posted February 5, 2013 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. Please do not PM me with scripting related question nor support, use the forums instead.
FreeGells Posted February 5, 2013 Author 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.
Stanley Sathler Posted February 6, 2013 Posted February 6, 2013 Poste o atual código para que possamos ver qual o problema. Software Engineer & Entrepreneur • Running Lustrel and VilarikA • Highly engaged on open source community
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