DukeeH
Active Member
- Joined
- Dec 6, 2010
- Messages
- 550
- Solutions
- 3
- Reaction score
- 39
Hello, I'm trying to rewrite some old scripts and I need help as 1.x (1.3 on my case) doesn't have online column on table players.
This is the code I used to have:
Tried a few changes like:
db.getResult to db.storeQuery...
But I have no idea a good way to get the same result on 1.x
Thanks guys.
This is the code I used to have:
Lua:
function onThink(interval)
local query = db.getResult("Select * FROM `players` WHERE `level` > 350 and `online`=1 ORDER BY `level` DESC;")
if query:getID() ~= -1 then
local name = query:getDataString("name")
if isPlayerOnline(name) then
end
end
return TRUE
end
function isPlayerOnline(name)
players=getPlayersOnline()
for _,pid in ipairs(players) do
if getPlayerName(pid):lower() == name:lower() then
return true
end
end
return false
end
db.getResult to db.storeQuery...
But I have no idea a good way to get the same result on 1.x
Thanks guys.