Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
function onSay(cid)
nick = db.query("SELECT `name` FROM `players`, ORDER BY `level` LIMIT 1;")
print("The best player is ".. nick.. "")
return true
end
LUA:
function onSay(cid)
nick = db.query("SELECT `name` FROM `players` ORDER BY `level` WHERE `vocation` = 4 OR `vocation` = 8 LIMIT 1;")
print("The best knight is ".. nick .. "")
return true
end
function onSay(cid)
local res = db.query("SELECT `name` FROM `players`, ORDER BY `level` LIMIT 1;")
if res:getID() ~= -1 then
print("The best player is ".. res:getDataString("name").. "")
res:free()
end
return true
end
LUA:
function onSay(cid)
local res = db.query("SELECT `name` FROM `players` ORDER BY `level` WHERE `vocation` = 4 OR `vocation` = 8 LIMIT 1;")
if res:getID() ~= -1 then
print("The best knight is ".. res:getDataString("name") .. "")
res:free()
end
return true
end
[9:48:51.015] [Error - TalkAction Interface]
[9:48:51.015] data/talkactions/scripts/testy.luanSay
[9:48:51.015] Description:
[9:48:51.015] data/talkactions/scripts/testy.lua:3: attempt to index local 'res' (a boolean value)
[9:48:51.015] stack traceback:
[9:48:51.015] data/talkactions/scripts/testy.lua:3: in function <data/talkactions/scripts/testy.lua:1>
but working:
Code:
function onSay(cid)
print(db.getResult("SELECT `name` FROM `players` ORDER BY `level` DESC LIMIT 1"):getDataString("name"))
return true
end