ParadoxTR Posted September 23, 2015 Posted September 23, 2015 I'm doing Clan points. I used to elementdata and sql clan points for it. How can I get the highest score clan SQL or Data? Help
wwz Posted September 23, 2015 Posted September 23, 2015 You could do this Make a table of player then Take a global variable x Then make function in which Make a for loop for player In table and check With getelement data which player score Is great then assingn x to player At the end of loop player with highest point would be stored in x
ParadoxTR Posted September 23, 2015 Author Posted September 23, 2015 I'dont understand. Plase give me example.
anumaz Posted September 23, 2015 Posted September 23, 2015 Help me. Found a lua function. Simply edit it with what you need. local max_val, key = -math.huge for k, v in pairs(your_table) do if v > max_val then max_val, key = v, k end end print(key, max_val)
wwz Posted September 24, 2015 Posted September 24, 2015 local tab ={} local highest function rank() for i,v ipairs(getElementsByType("player")) do tab=v; end highest = tab[1]; for i,v ipairs(tab) do if(getElementData(tab,your data)> getElementData(highest,your data) then highest = tab; end end Player with highest score will be in variable highest
TAPL Posted September 24, 2015 Posted September 24, 2015 http://www.w3schools.com/sql/sql_orderby.asp
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