local i = {}
function onSay(cid, words, param, channel)
if (param == '') then
return doPlayerSendTextMessage(cid, 27, "Command param required.") and true
end
if not (isNumber(param)) then
return doPlayerSendTextMessage(cid, 27, "Command param should only be numbers") and true
end
local o = db.getResult("SELECT MAX(id) AS id FROM accounts")
local u = o:getDataInt('id')
if (param > ''..u..'') then
doPlayerSendTextMessage(cid, 27, "Sorry, the highest account id value is "..u)
else
local w = db.getResult("SELECT name FROM accounts WHERE id ="..param)
local q = w:getDataInt('name')
for _, pid in ipairs(getPlayersOnline()) do
if (getPlayerAccount(pid) == ''..q..'') then
table.insert(i, {getCreatureName(pid), getPlayerLevel(pid)})
end
end
doPlayerSendTextMessage(cid, 27, "Players online with account id "..param..":")
if (#i == 0) then
doPlayerSendTextMessage(cid, 27, "None")
end
for k = 1, #i do
doPlayerSendTextMessage(cid, 27, k..": Name: "..i[k][1]..", level: "..i[k][2]..".")
end
i = {}
end
return TRUE
end