Opa, gostaria de saber como faço para que quando o rank for chamado ele organize em ordem por Kills. Tipo 1,2,3 e etc...
function recebeKills ()
local data = getAccounts ()
local accTable = {}
local killsTable = {}
local deathsTable = {}
local killDeath = {}
local kill = 0
local death = 0
if not data[1] then
triggerClientEvent (client, "showScores", client)
return
end
for i, acc in ipairs (data) do
table.insert (accTable, getAccountName (data[i]))
if not getAccountData (data[i], "kills") then
table.insert (killsTable, "0")
kill = 0
else
table.insert (killsTable, tostring (getAccountData (data[i], "kills")))
kill = tonumber (getAccountData (data[i], "kills"))
end
if not getAccountData (data[i], "deaths") then
table.insert (deathsTable, "0")
death = 0
else
table.insert (deathsTable, tostring (getAccountData (data[i], "deaths")))
death = tonumber (getAccountData (data[i], "deaths"))
end
if death == 0 and kill == 0 then
table.insert (killDeath, 0)
else
table.insert (killDeath, kill / death)
end
end
triggerClientEvent (client, "showRank", client, accTable, killsTable, deathsTable, killDeath)
end
addEvent ("getRank", true)
addEventHandler ("getRank", getRootElement(), recebeKills)