• 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!

Lua 3 problems in LUA

Gothric

New Member
Joined
Feb 6, 2010
Messages
264
Reaction score
1
1. I want to send player message when he look at item with uid ,
its function onLook and i tried if thing.uid == xxxx then

but its doesnt work :|

2. I want to get information from database about best player ( person who have the best level)

i tried this
PHP:
 db.getResult("SELECT `level` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";"):getDataInt("level")

but it doesnt work but if it would work it would show Level of player cid :S but i want to show player who have the best level

3. The same as point 2 but i want to get information about concrete proffesion, for example i look on the door and i see the best knight on the server
 
Last edited:
1- tihng.itemid == XXXX

2 -
Code:
local c =  db.getResult("SELECT `level`,`name` FROM `players` ORDER BY `level` DESC LIMIT 1;")
local level = c:getDataInt('level')
local name = c:getDataString('name')


3 -
Code:
local c =  db.getResult("SELECT `level`,`name` FROM `players` WHERE `vocation` = '4' ORDER BY `level` DESC LIMIT 1;")
local level = c:getDataInt('level')
local name = c:getDataString('name')
 
thank you very much :D for help me in point 2 and 3 but there is problem in point 2

there is unique id on map :/ and i want to use uid
 
Back
Top