Xemorin
/
- Joined
- Jan 6, 2011
- Messages
- 552
- Reaction score
- 65
Skrypt dzia?a tak jak
, z t? r??nic?, ?e nie wymagam za takie co? got?wki . W skrypcie ustawione jest, ?e wy?wietla graczy z group_id mniejszym ni? 2 (czyli gracze, tutorzy)!
Oczywi?cie skrypt mo?na ?atwo edytowa? dodaj?c np. wy?wietlanie mlvla profesji magicznych.
Do globalevents.xml dodaj (ustawione od?wie?anie co 15 sekund):
Stw?rz plik hof.lua i umie?? w nim:
Jakie? zdj?cie:
Oczywi?cie skrypt mo?na ?atwo edytowa? dodaj?c np. wy?wietlanie mlvla profesji magicznych.
Do globalevents.xml dodaj (ustawione od?wie?anie co 15 sekund):
Code:
<globalevent name="hof" interval="15000" event="script" value="hof.lua"/>
PHP:
-- by Xemorin --
local tbl = {
[1] = {pos= {x = 1002, y = 986, z = 7, stackpos = 1}, prof = 'all', text2 = 'player'}, -- lvl
[2] = {pos= {x = 999, y = 985, z = 7, stackpos = 1}, prof = '1, 5', text2 = 'sorcerer'}, -- sorcerer, ms
[3] = {pos= {x = 1001, y = 984, z = 7, stackpos = 1}, prof = '2, 6', text2 = 'druid'}, -- druid, ed
[4] = {pos= {x = 1003, y = 984, z = 7, stackpos = 1}, prof = '3, 7', text2 = 'paladin'}, -- palladin, rp
[5] = {pos= {x = 1005, y = 985, 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'},
}
function onThink(interval)
local best, profe, kam = '', 0, 0
for index, options in ipairs(tbl) 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
return true
end
Kopiujcie gdzie chcecie, tylko podajcie autora :<