Jump to content

استفسار


Recommended Posts

كذا ؟

  
  
  
addEvent("onClientReceiveTopListTable",true) 
addEventHandler("onClientReceiveTopListTable",root, 
function(t) 
rankTable = t 
UpdateTopList() 
end) 
  
function UpdateTopList() 
guiGridListClear(Gridilist) 
for k,v in ipairs(rankTable) do  
local row = guiGridListAddRow(Gridilist) 
guiGridListSetItemText(Gridilist,row,1,v["playerName"],false,false) 
guiGridListSetItemText(Gridilist,row,2,v["Value"],false,false) 
end 
end 
  
  
  
  

  
  
function onChangeNick(old,new) 
local acc = getPlayerAccount(source) 
if(acc and isGuestAccount(acc)==false)then  
local nickAcc = string.gsub(new,"#%x%x%x%x%x%x","") 
setAccountData(acc,"PlayerName",nickAcc) 
end 
end 
addEventHandler("onPlayerChangeNick",root,onChangeNick) 
  
  
addEvent("onTopPlayerListRequest",true) 
addEventHandler("onTopPlayerListRequest",root, 
function() 
local allAccounts = getAccounts() 
local sendTable = {} 
local data = 0 
for k,v in ipairs(allAccounts) do 
if(data>0)then 
table.insert(sendTable,{["playerName"] = name,["Value"] = data}) 
end 
end 
table.sort(sendTable,function(a,b) return tonumber(a["Value"] or 0)>tonumber(b["Value"] or 0) end) 
table.setMaxIndex(sendTable,5) 
for i=1,#sendTable do 
end 
end 
for i=1,#sendTable do 
local acc = getAccount(sendTable[i]["playerName"]) 
local accRealName = getAccountData(acc,"PlayerName") 
if(accRealName and tostring(accRealName)~="false")then  
sendTable[i]["playerName"] = accRealName 
end 
end 
triggerClientEvent(client,"onClientReceiveTopListTable",client,sendTable) 
end) 
  
  

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