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

highest level chair

4Muki4

HOROHOROHORO
Joined
May 1, 2012
Messages
757
Reaction score
70
Hello,

I've searched in otland i can''t find it so i made this thread. In map there is a chair and only the highest in server can sit there
 
Code:
local function getHighestPlayer()
     local result = db.getResult("SELECT `name` FROM `players` ORDER BY `level` DESC, `experience` DESC LIMIT 1")
     return result.getDataString(result, "name")
end

function onStepIn(cid, item, position, fromPosition)

     if not isPlayer(cid) then
         return true
     end

     if getPlayerName(cid) == getHighestPlayer() then
         doPlayerSendCancel(cid, "You are the player with the highest level at the moment and can sit on the chair.")
         doSendMagicEffect(position, CONST_ME_FIREWORK_YELLOW)
     else
         doTeleportThing(cid, fromPosition)
         doPlayerSendCancel(cid, "Only the player with highest level can sit here. The player with the highest level is "..getHighestPlayer()..".")
     end
     return true
end
 
Back
Top