Unass
Active User
- Joined
- Jul 21, 2010
- Messages
- 123
- Reaction score
- 22
Witam,
Chcialem Wam przedstawic skrypt w 100% napisany przeze mnie. Nigdzie takowego nie widzialem wiec zdecydowalem sie go udostepnic.
Przyklad
data/creaturescripts/scripts
posagi.lua
creaturescripts.xml
login.lua
Zabraniam kopiowania/publikowania skryptu na innych forach
Script By Unass
Chcialem Wam przedstawic skrypt w 100% napisany przeze mnie. Nigdzie takowego nie widzialem wiec zdecydowalem sie go udostepnic.
Jego dzialanie jest proste. Mianowicie po spojrzeniu na dany posag (ktoremu wczesniej nadalismy uid) wyskakuje nam wiadomosc o tym kto ma najwyzszy lvl z danej profesji na serwerze.
Przyklad
13:09 Test(305 lvl) is currently the best knight on the server.
data/creaturescripts/scripts
posagi.lua
Code:
--Script By Unass--
local all = 1550 -- uid posagu ktory pokazuje najlepszego gracza na serwerze
local profesje =
{
[1552] = {1, "sorcerer"},
[1553] = {2, "druid"},
[1554] = {3, "paladin"},
[1551] = {4, "knight"},
}
function onLook(cid, item, position, lookDistance)
if item.uid == all then
c = db.getResult("SELECT `level`,`name` FROM `players` ORDER BY `level` DESC LIMIT 1;")
Level = c:getDataInt('level')
Name = c:getDataString('name')
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "" .. Name .. "(".. Level .." lvl) is currently the best player on the server.")
return false
end
tab = profesje[item.uid]
if(tab == nil) then
return true
end
c = db.getResult("SELECT `level`,`name` FROM `players` WHERE `vocation` = '"..tab[1].."' ORDER BY `level` DESC LIMIT 1;")
Level = c:getDataInt('level')
Name = c:getDataString('name')
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "" .. Name .. "(".. Level .." lvl) is currently the best "..tab[2].." on the server.")
end
creaturescripts.xml
Code:
<event type="look" name="Posagi" event="script" value="posagi.lua"/>
login.lua
Code:
registerCreatureEvent(cid, "Posagi")
Zabraniam kopiowania/publikowania skryptu na innych forach
Script By Unass