i want statue say who is currently highest level, of every voc
local GROUP_FILTER = 3 -- this is the highscore cutoff (it's usually 3 for gods and 2 for tutors, so we start at 3)
function onLook(cid, thing, position, lookDistance)
if(thing.itemid)then -- yay it's an item, we won't get a nil error!
if(thing.itemid == 9751)then -- now that we know its safe to index this value, we can check the itemid
local player = db.getResult("SELECT name, level FROM `players` WHERE group_id < " .. GROUP_FILTER .. " ORDER BY `level` DESC LIMIT 1;")
local name, level = player:getDataString("name"), player:getDataInt("level")
player:free()
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You see a statue of " .. name .. " (" .. level .. ").\nHighest level on the server.")
return false
end
end
return true
end
local GROUP_FILTER = 3 -- this is the highscore cutoff (it's usually 3 for gods and 2 for tutors, so we start at 3)
function onLook(cid, thing, position, lookDistance)
if(thing.itemid)then -- yay it's an item, we won't get a nil error!
if(thing.itemid == 9751)then -- now that we know its safe to index this value, we can check the itemid
local player = db.getResult("SELECT name, level FROM `players` WHERE group_id < " .. GROUP_FILTER .. " ORDER BY `level` DESC LIMIT 1;")
local name, level = player:getDataString("name"), player:getDataInt("level")
player:free()
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You see a statue of " .. name .. " (" .. level .. ").\nHighest level on the server.")
return false
end
end
return true
end