HoLsTeN Posted October 29, 2011 Share Posted October 29, 2011 Hi All i am trying to make a top10 script for my server it is show the top10 by His EXP but i dont know how to start i make the gui this is the client code top_window = guiCreateWindow(248,95,417,409,"TOP 10 ",false) top_grid = guiCreateGridList(9,25,399,333,false,top_window) guiGridListSetSelectionMode(top_grid,2) guiGridListAddColumn(top_grid,"Player Name",0.2) guiGridListAddColumn(top_grid,"EXP",0.2) guiGridListAddColumn(top_grid,"Lvl",0.2) guiGridListAddColumn(top_grid,"RANK",0.2) close_ = guiCreateButton(106,363,224,31,"CLOSE",false,top_window) function ShowTheGui() if (guiGetVisible(top_window) == true) then guiSetVisible(top_window, false) showCursor(false) else guiSetVisible(top_window, true) showCursor(true) end end bindKey("F2","down",ShowTheGui) function CloseTheGui (button, state, absoluteX, absoluteY) if (source == close_) then guiSetVisible (top_window, false) showCursor(false) end end addEventHandler ("onClientGUIClick", getRootElement(), CloseTheGui) and this is the AccountData local ExpData = getAccountData (account, "exp") local LevelData = getAccountData (account, "level") local RankData = getAccountData (account, "rank") EDIT : And this with ElementData theExp = getElementData(source, "EXP") theRank = getElementData(source, "Rank") theNext = getElementData(source, "NEXT") i dont know how to make it Link to comment
12p Posted October 29, 2011 Share Posted October 29, 2011 2 things: getAccounts ( ) table.sort table.sort can be found at http://lua-users.org/wiki/TableLibraryTutorial Link to comment
Aibo Posted October 29, 2011 Share Posted October 29, 2011 or store your data in your own SQL table and use SQL select/order by/limit queries. and maybe there's a way to access internal.db where account data is stored, i'm not sure nowadays. but i'm pretty sure getting ALL accounts (unless there are like 10 in total) and sorting them in Lua is not the best way. Link to comment
12p Posted October 29, 2011 Share Posted October 29, 2011 Yep, but I made a system like that, in the accounts way. It worked fine. SQL is obviously better but I prefer accounts Link to comment
HoLsTeN Posted October 29, 2011 Author Share Posted October 29, 2011 i think it is hard for me : thanks any whay 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