Hello
How I can sort players by health in this scrpit:
Example:
In table have inserted this values (by scrpit above):
players = {238437203, 238437204, 238437205, 238437206}
and they have miscellaneous health:
{450, 500, 315, 205}
And after sort table will looking like that:
players = {238437206, 238437205, 238437203, 238437204}
Is way to do it??
Thanks and rep for help :thumbup:
How I can sort players by health in this scrpit:
Lua:
local list = getSpectators(getCreaturePosition(cid), 5, 7, false)
local players = {}
if(#list > 0) then
for i = 1, #list do
if(isPlayer(list[i])) then
table.insert(players, list[i])
end
end
end
In table have inserted this values (by scrpit above):
players = {238437203, 238437204, 238437205, 238437206}
and they have miscellaneous health:
{450, 500, 315, 205}
And after sort table will looking like that:
players = {238437206, 238437205, 238437203, 238437204}
Is way to do it??
Thanks and rep for help :thumbup:
Last edited: