Jump to content

help in accountdata


HoLsTeN

Recommended Posts

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 :roll:

Link to comment

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

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