- 0
3 answers to this question
Recommended Posts
This topic is now closed to further replies.
Sign in to follow this
Followers
0
-
Recently Browsing 0 members
No registered users viewing this page.
Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.).
The OTX Server Version: (2.100 - 6000) - Codename: (FINAL) 7.6
Qual é a sua pergunta?
Tenho uma talkaction que deveria mostrar as spells que os players possuem, mas ela retorna em branco, seguem scripts.
talkactions\talkactions.xml
talkactions\scripts\spellbook.lua
function onSay(cid, words, param, channel) local t, k = {}, getPlayerLevel(cid) for i = 0, getPlayerInstantSpellCount(cid) - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if(spell.level ~= 0 and k >= spell.level) then if(spell.manapercent > 0) then spell.mana = spell.manapercent .. "%" end table.insert(t, spell) end end table.sort(t, function(a, b) return a.level < b.level end) local text, prevLevel = "", -1 for i, spell in ipairs(t) do local line = "" if(prevLevel ~= spell.level) then if(i ~= 1) then line = "\n" end line = line .. "Spells for Level " .. spell.level .. "\n" prevLevel = spell.level end text = text .. line .. " " .. spell.words .. " - " .. spell.name .. " : " .. spell.mana .. "\n" end doShowTextDialog(cid, 2175, text) return true end
Quando uso o comando, retorna o spellbook vazio
Share this post
Link to post
Share on other sites