goodiewarrior Posted July 14, 2016 Posted July 14, 2016 Ok, so online time is stored like this: local user_time = getAccountData(account, "on_time") Now if I want to make a GUI with the most 3 online users in the server, how can I do that?
Simple0x47 Posted July 14, 2016 Posted July 14, 2016 Just make use of loops and getAccounts. "Keep making it simplex."
goodiewarrior Posted July 17, 2016 Author Posted July 17, 2016 and then how to order the values from getAccountData(v) from higher to lower...
Walid Posted July 17, 2016 Posted July 17, 2016 and then how to order the values from getAccountData(v) from higher to lower... All what you need is: table.insert() table.sort() Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
Captain Cody Posted July 17, 2016 Posted July 17, 2016 table = {} for i,v in pairs (getAccounts()) do local time = getAccountData(v, "on_time") table.insert(table,{v,time}) end table.sort(table) local 1= table[1] local 2= table[2] local 3= table[3] local first = getAccountName(1[1]) local secound= getAccountName(2[1]) local third= getAccountName(3[1]) Not tested, and could be put together better, but quick example.
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