Jump to content

Ajuda com GUI


Recommended Posts

Posted

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á! :)

Posted

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

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...