Good night, I need help in a basic system but I don't know how to do kk.
I have a function to see the ranking of an event system
I'm wondering how do I get the player by placing
Example:
Miguel is in first with 100 points
Josue in second with 90 points
I want to be able to return Josue's ID
My Function:
I have a function to see the ranking of an event system
I'm wondering how do I get the player by placing
Example:
Miguel is in first with 100 points
Josue in second with 90 points
I want to be able to return Josue's ID
My Function:
Code:
function getRankArenaSurviver() --alterado v1.9 \/
local query = db.getResult("SELECT `id`, `arenasurviver` FROM `players` ORDER BY `arenasurviver` DESC;")
local str = {}
table.insert(str, "Rank of the Surviver Arena:\n\n")
if query:getID() ~= -1 then
for i = 1, 10 do
if not(query:next()) or query:getDataInt("arenasurviver") == 0 then
table.insert(str, i.."* None - 0 level.\n")
else
local s = tonumber(query:getDataInt("arenasurviver")) > 1 and "s" or ""
table.insert(str, i.."* "..getPlayerNameByGUID(query:getDataString("id")).." - "..query:getDataInt("arenasurviver").." level"..s..".\n")
end
end
query:free()
end
return table.concat(str)
end