Wisin Posted September 19, 2010 Share Posted September 19, 2010 hey, i want to make a resource of 10 best players in server, i've done a gui added a grid list and now i need help about how i can get from a kills data the best 10 players? if someone can help me i will be really appreciated. Link to comment
dzek (varez) Posted September 19, 2010 Share Posted September 19, 2010 im not sure if you can do this witout sqlite/mysql - as you can't get data from offline players. just save kills to database, then just select, ordering by kills. Link to comment
Wisin Posted September 19, 2010 Author Share Posted September 19, 2010 im not sure if you can do this witout sqlite/mysql - as you can't get data from offline players.just save kills to database, then just select, ordering by kills. i'm actually using account data to save their kills, but my question is how i can retrive highest data and stop adding when reaches 10? hope someone can give me a code to start Link to comment
dzek (varez) Posted September 19, 2010 Share Posted September 19, 2010 i think it's not possible to getAccountData of player which is not on the server. you without database you will be able only to create a rank of online players - which is nothing useful i think Link to comment
Wisin Posted September 19, 2010 Author Share Posted September 19, 2010 i think it's not possible to getAccountData of player which is not on the server. you without database you will be able only to create a rank of online players - which is nothing useful i think ok then i think the sqlite from mta would be nice? Link to comment
dzek (varez) Posted September 19, 2010 Share Posted September 19, 2010 yup. for sqlite you dont need to download anything - its included Link to comment
50p Posted September 21, 2010 Share Posted September 21, 2010 i think it's not possible to getAccountData of player which is not on the server. you without database you will be able only to create a rank of online players - which is nothing useful i think Well said, you "think".. https://wiki.multitheftauto.com/wiki/GetAccount https://wiki.multitheftauto.com/wiki/GetAccounts 1 Link to comment
Wisin Posted September 21, 2010 Author Share Posted September 21, 2010 i think it's not possible to getAccountData of player which is not on the server. you without database you will be able only to create a rank of online players - which is nothing useful i think Well said, you "think".. https://wiki.multitheftauto.com/wiki/GetAccount https://wiki.multitheftauto.com/wiki/GetAccounts You are my salvation dude! thank you very much! Edit: Hmm could someone give me a little example of how i can get the highest kills from the table of accounts? Link to comment
Wisin Posted September 22, 2010 Author Share Posted September 22, 2010 can someone tell me how to do the last thing i asked? Link to comment
dzek (varez) Posted September 22, 2010 Share Posted September 22, 2010 Patience is good thing. Text-description: prepare table for top 10, Loop through all accounts, if table size is smaller than 10 - just add values, if its size equals to 10 loop through whole table, if one of values is less than value from account - remove smallest value from table and add that one from current account in your loop. At the end-sort the table. Maybe lua have some sorting functions-if not, search google for sorting function and use it. Link to comment
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