Postado Maio 20, 2015 11 anos function onUse(cid, item, fromPosition, itemEx, toPosition) local count = getPlayerInstantSpellCount(cid) local text = "" local t = {} for i = 0, count - 1 do local spell = getPlayerInstantSpellInfo(cid, i) if spell.level ~= 0 then if spell.manapercent > 0 then spell.mana = spell.manapercent .. "%" spell.soul = getInstantSpellInfoByName(cid, soul) spell.voc = getInstantSpellInfoByName(cid, vocationid) end table.insert(t, spell) end end table.sort(t, function(a, b) return a.level < b.level end) local 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 .. " Palavra chave:" .. spell.words .. " - Nome da spell: " .. spell.name .. " Mana: " .. spell.mana .. " Soul:".. spell.soul .." Voc:".. spell.voc .."\n" end doShowTextDialog(cid, item.itemid, text) return TRUE end Editado Maio 20, 2015 11 anos por Vinicius Xxgamexx (veja o histórico de edições)
Postado Maio 20, 2015 11 anos Autor function onUse(cid, item, fromPosition, itemEx, toPosition)local count = getPlayerInstantSpellCount(cid)local text = ""local t = {}for i = 0, count - 1 dolocal spell = getPlayerInstantSpellInfo(cid, i)if spell.level ~= 0 thenif spell.manapercent > 0 thenspell.mana = spell.manapercent .. "%"spell.soul = getInstantSpellInfoByName(cid, soul)spell.voc = getInstantSpellInfoByName(cid, vocationid)endtable.insert(t, spell)endendtable.sort(t, function(a, b) return a.level < b.level end)local prevLevel = -1for i, spell in ipairs(t) dolocal line = ""if prevLevel ~= spell.level thenif i ~= 1 thenline = "\n"endline = line .. "Spells for Level " .. spell.level .. "\n"prevLevel = spell.levelendtext = text .. line .. " Palavra chave:" .. spell.words .. " - Nome da spell: " .. spell.name .. " Mana: " .. spell.mana .. " Soul:".. spell.soul .." Voc:".. spell.voc .."\n"enddoShowTextDialog(cid, item.itemid, text)return TRUEend Action? Usei em action e deu erro, e em talkaction não funcionou. Editado Maio 20, 2015 11 anos por ScythePhantom (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.