Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- by Xemorin --
- local lvl = {
- [1] = {pos= {x = 92, y = 114, z = 7, stackpos = 1}, prof = 'all', text2 = 'player'}, -- lvl
- [2] = {pos= {x = 93, y = 114, z = 7, stackpos = 1}, prof = '1, 5', text2 = 'sorcerer'}, -- sorcerer, ms
- [3] = {pos= {x = 94, y = 114, z = 7, stackpos = 1}, prof = '2, 6', text2 = 'druid'}, -- druid, ed
- [4] = {pos= {x = 95, y = 114, z = 7, stackpos = 1}, prof = '3, 7', text2 = 'paladin'}, -- palladin, rp
- [5] = {pos= {x = 96, y = 114, z = 7, stackpos = 1}, prof = '4, 8', text2 = 'knight'}, -- knight, ek
- --[index] = {pos = {pozycja, pamietaj o stackpos!}, prof = 'id profesji', text2 = 'string z nazwa profesji'},
- }
- local skill = {
- {pos = {x = 92, y = 114, z = 7, stackpos = 1}, skill = 0, text2 = 'fist'}, -- fist
- {pos = {x = 93, y = 114, z = 7, stackpos = 1}, skill = 1, text2 = 'club'}, -- club
- {pos = {x = 94, y = 114, z = 7, stackpos = 1}, skill = 2, text2 = 'sword'}, -- sword
- {pos = {x = 95, y = 114, z = 7, stackpos = 1}, skill = 3, text2 = 'axe'}, -- axe
- {pos = {x = 96, y = 114, z = 7, stackpos = 1}, skill = 4, text2 = 'dist'}, -- dist
- {pos = {x = 97, y = 114, z = 7, stackpos = 1}, skill = 5, text2 = 'shield'}, -- shield
- {pos = {x = 98, y = 114, z = 7, stackpos = 1}, skill = 6, text2 = 'fish'}, -- fishing
- }
- function onThink(interval)
- local best, profe, kam = '', 0, 0
- for index, options in ipairs(lvl) do
- local kam = getThingFromPos(options.pos).uid
- if(options.prof == 'all') then
- best = db.getResult("SELECT `level`,`name` FROM `players` WHERE `group_id` < '2' AND `account_id` > '1' ORDER BY `experience` DESC LIMIT 1;")
- if(best:getID() ~= -1) then
- doItemSetAttribute(kam, 'description', 'Currently, the best '..options.text2..' is '..best:getDataString('name')..' ('..best:getDataInt('level')..' level)')
- else
- doItemSetAttribute(kam, 'description', 'Currently there are no characters')
- end
- doSendMagicEffect(options.pos, CONST_ME_FIREWORK_RED)
- else
- profe = string.explode(options.prof, ',')
- best = db.getResult("SELECT `level`,`name` FROM `players` WHERE (`vocation` = '"..tonumber(profe[1]).."' OR `vocation` = '"..tonumber(profe[2]).."') AND `group_id` < '2' AND `account_id` > '1' ORDER BY `experience` DESC LIMIT 1;")
- if(best:getID() ~= -1) then
- doItemSetAttribute(kam, 'description', 'Currently, the best '..options.text2..' is '..best:getDataString('name')..' ('..best:getDataInt('level')..' level)')
- else
- doItemSetAttribute(kam, 'description', 'Currently, on a server doesn\'t play none '..options.text2)
- end
- doSendMagicEffect(options.pos, CONST_ME_FIREWORK_RED)
- end
- end
- for index, options in ipairs(skill) do
- local kam = getThingFromPos(options.pos).uid
- best = db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = '"..options.skill.."' ORDER BY `count` DESC LIMIT 1;")
- local name = getPlayerNameByGUID(best:getDataInt('player_id'))
- if(best:getID() ~= -1 and name ~= '' and name ~= nil) then
- doItemSetAttribute(kam, 'description', 'Currently, the biggest '..options.text2..'\'er is '..name..' ('..best:getDataInt('value')..' level)')
- else
- doItemSetAttribute(kam, 'description', 'Currently there are no characters')
- end
- doSendMagicEffect(options.pos, CONST_ME_FIREWORK_RED)
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment