Code:
-- a Capaverde's production
local function sittable(k,v)
table.insert(tabela,{k,v})
end
local function sorttable(a,b) -- tried to put it into alphabetical order
return string.byte(a[1],1) < string.byte(b[1],1)
end
function onUse(cid, item, frompos, item2, topos)
tabela = {}
table.foreach(_G,sittable)
table.sort(tabela,sorttable)
for k,v in ipairs(tabela) do
if type(v[2]) == "function" then
doPlayerSendTextMessage(cid,22,v[1])
end
end
return 1
end