Jump to content

Tables


Baseplate

Recommended Posts

Posted
function getOnlineMems() 
    local memsTable = {} 
    for k, v in pairs (getElementsByType("player")) do 
        if (isPlayerMem(v)) then 
            table.insert(memsTable, v) 
            return memsTable 
        end 
    end 
end 
  

Now pretty much, whenever I try to get the table it returns with 1 members only and doesn't return all the online members.

Posted
Well, you're returning the table with every execution, instead return the table after the for loop has finished.

Thank fuck, thanks mate works like a charm mate! :)

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