Jump to content

accountData problem


Fury

Recommended Posts

function clanTeamListFunc(source) 
    local rowdata = {} 
    local inumber = 0 
    for i, v in pairs(getAccounts()) do 
            inumber = inumber + 1 
            rowdata[inumber] = 
            { 
                team = getAccountData(v, "team") or "Empty" 
            } 
    end 
    if (inumber ~= 0) then 
            table.sort ( 
        rowdata, 
        function ( a, b ) 
            return (  a.team or 0 ) < (  b.team or 0 ) 
        end 
                ) 
        return rowdata 
    end 
end 

hey guys i have this code. but i have a problem. it gets every "team" data on every player. i wanna get just only not empty data's. can you help me please? :)

Link to comment
function clanTeamListFunc(source) 
    local rowdata = {} 
    local inumber = 0 
    for i, v in pairs(getAccounts()) do 
            inumber = inumber + 1 
            local tName = getAccountData(v,'team') 
            if tName then 
                rowdata[inumber] = 
                { 
                    team = tName 
                } 
            end 
    end 
    if (inumber ~= 0) then 
            table.sort ( 
        rowdata, 
        function ( a, b ) 
            return (  a.team or 0 ) < (  b.team or 0 ) 
        end 
                ) 
        return rowdata 
    end 
end 

karthik_184 solve the problem. thank you dude :)

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