Jump to content

Grid list


TheIceman1

Recommended Posts

Why this dont set clans on gridlist?No errors.

function setclans () 
guiSetVisible ( GUIEditor_Window[4], true ) 
showCursor ( true ) 
    for _, clan in ipairs ( getElementData ( localPlayer, "clan" ) ) do 
            local rowc = guiGridListAddRow ( GUIEditor_Grid[4] ) 
            local clant = getElementData ( clan, "type" ) 
            guiGridListSetItemText ( GUIEditor_Grid[4], rowc, GUIEditor_Column[5], clan, false, false ) 
            guiGridListSetItemText ( GUIEditor_Grid[4], rowc, GUIEditor_Column[6], clant, false, false ) 
    end 
end 
addCommandHandler ( "clans", setclans ) 

Link to comment

So localPlayer elementData "clan" contains a string?

If that's the case, obviously clan cannot hold elementData cause its a simple string, and not an element.

It won't work by that way.

Now, if you want, WHAT YOU SHOULD DO, is to attach to the elementData a table holding the data like this:

table = { 
     ["clan1"] = "deathmatch", 
     ["clanPro"] = "race" 
} 

And if you are trying to show the TEAMS, you should get the teams from serverside and trigger them, or create a dummy element and add it as elementData so you can get the dummy element and it's element data.

Link to comment

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...