Postado Junho 9, 2018 7 anos 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, 11128, text) return true end Se alguém aceitar o desafio... Acredito que vai ajudar mais pessoas. Está funcionando desse jeito: Spells for Level 1 magia1 - nomedamagia1 : mana magia2 - nomedamagia2 : mana Spells for Level 2 magia3 - nomedamagia3 : mana magia4 - nomedamagia4 : mana Eu quero alterar para: Nota: Existem 13 promotions Nota2: Não precisa considerar level para usar a magia, nem mana. A informação será adicionada conforme a magia. Nota3: Mesmo se eu for KNIGHT, vai mostrar as magias de ELITE KNIGHT, MEGA KNIGHT, etc... SE FOR KNIGHT: Spells for Vocation VOCACAO1MAGIA1 - INFORMAÇÃO1 (EDITÁVEL) MAGIA2 - INFORMAÇÃO2 (EDITÁVEL) Spells for vocation VOCACAO2 (QUE É A SEGUNDA PROMOTION: Elite Knight) MAGIA3 - INFORMAÇÃO3 (EDITÁVEL) MAGIA4 - INFORMAÇÃO4 (EDITÁVEL) Spells for vocation VOCACAO3 (QUE É A TERCEIRA PROMOTION: Mega Knight) MAGIA5 - INFORMAÇÃO5 (EDITÁVEL) MAGIA6 - INFORMAÇÃO6 (EDITÁVEL) (etc...) SE FOR PALADIN: Spells for Vocation VOCACAO1MAGIA1 - INFORMAÇÃO1 (EDITÁVEL) MAGIA2 - INFORMAÇÃO2 (EDITÁVEL) Spells for vocation VOCACAO2 (QUE É A SEGUNDA PROMOTION: Royal Paladin) MAGIA3 - INFORMAÇÃO3 (EDITÁVEL) MAGIA4 - INFORMAÇÃO4 (EDITÁVEL) Spells for vocation VOCACAO3 (QUE É A TERCEIRA PROMOTION: Mega Paladin) MAGIA5 - INFORMAÇÃO5 (EDITÁVEL) MAGIA6 - INFORMAÇÃO6 (EDITÁVEL) (etc...) SE FOR DRUID: Spells for Vocation VOCACAO1MAGIA1 - INFORMAÇÃO1 (EDITÁVEL) MAGIA2 - INFORMAÇÃO2 (EDITÁVEL) Spells for vocation VOCACAO2 (QUE É A SEGUNDA PROMOTION: Elder Druid) MAGIA3 - INFORMAÇÃO3 (EDITÁVEL) MAGIA4 - INFORMAÇÃO4 (EDITÁVEL) Spells for vocation VOCACAO3 (QUE É A TERCEIRA PROMOTION: Mega Druid) MAGIA5 - INFORMAÇÃO5 (EDITÁVEL) MAGIA6 - INFORMAÇÃO6 (EDITÁVEL) (etc...) SE FOR SORCERER: Spells for Vocation VOCACAO1MAGIA1 - INFORMAÇÃO1 (EDITÁVEL) MAGIA2 - INFORMAÇÃO2 (EDITÁVEL) Spells for vocation VOCACAO2 (QUE É A SEGUNDA PROMOTION: Master Sorcerer) MAGIA3 - INFORMAÇÃO3 (EDITÁVEL) MAGIA4 - INFORMAÇÃO4 (EDITÁVEL) Spells for vocation VOCACAO3 (QUE É A TERCEIRA PROMOTION: Mega Sorcerer) MAGIA5 - INFORMAÇÃO5 (EDITÁVEL) MAGIA6 - INFORMAÇÃO6 (EDITÁVEL) (etc...) Muitos reps lhe aguardam, desde já obrigado! Editado Junho 9, 2018 7 anos por Daniel (veja o histórico de edições) Ot Design: https://discord.gg/VgtVRNmCD7
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.