Guest User

Untitled

a guest
May 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. local i = {}
  2. function onSay(cid, words, param, channel)
  3.     if (param == '') then
  4.         return doPlayerSendTextMessage(cid, 27, "Command param required.") and true
  5.     end
  6.     if not (isNumber(param)) then
  7.         return doPlayerSendTextMessage(cid, 27, "Command param should only be numbers") and true
  8.     end
  9.     local o = db.getResult("SELECT MAX(id) AS id FROM accounts")
  10.     local u = o:getDataInt('id')
  11.     if (param > ''..u..'') then
  12.         doPlayerSendTextMessage(cid, 27, "Sorry, the highest account id value is "..u)
  13.     else
  14.     local w = db.getResult("SELECT name FROM accounts WHERE id ="..param)
  15.     local q = w:getDataInt('name')
  16.         for _, pid in ipairs(getPlayersOnline()) do
  17.             if (getPlayerAccount(pid) == ''..q..'') then
  18.                 table.insert(i, {getCreatureName(pid), getPlayerLevel(pid)})
  19.             end
  20.         end
  21.             doPlayerSendTextMessage(cid, 27, "Players online with account id "..param..":")
  22.             if (#i == 0) then
  23.                 doPlayerSendTextMessage(cid, 27, "None")
  24.             end
  25.             for k = 1, #i do
  26.            
  27.                 doPlayerSendTextMessage(cid, 27, k..": Name: "..i[k][1]..", level: "..i[k][2]..".")
  28.             end
  29.             i = {}
  30.     end
  31. return TRUE
  32. end
Add Comment
Please, Sign In to add comment