Postado Setembro 28, 2015 9 anos Acho que isso resolve: local spells = { [1] = { --sorcerer level = { [1] = "utevo lux", "exura", "adori", [40] = "exevo gran mas vis" } }, [2] = { --druid level = { [1] = "utevo lux", "exura", "adori", [28] = "exevo gran mas pox" } }, [3] = { --paladin level = { [1] = "utevo lux", "exura", "exevo con", [14] = "exevo con vis" } }, [4] = { --knight level = { [1] = "utevo lux", "exura", [5] = "exori" } } } local array_sorc = {"Sorcerer", "Master Sorcerer", "Epic Sorcerer"} local array_druid = {"Druid", "Elder Druid", "Epic Druid"} local array_paladin = {"Paladin", "Royal Paladin", "Epic Paladin"} local array_knight = {"Knight", "Elite Knight", "Epic Knight"} local text = "" function onAdvance(cid, skill, oldLevel, newLevel) if skill == SKILL__MAGLEVEL then if isInArray(array_sorc, getPlayerVocationName(cid)) then CONFIG = spells[1] elseif isInArray(array_druid, getPlayerVocationName(cid)) then CONFIG = spells[2] elseif isInArray(array_paladin, getPlayerVocationName(cid)) then CONFIG = spells[3] elseif isInArray(array_knight, getPlayerVocationName(cid)) then CONFIG = spells[4] end if not CONFIG then return false end EVENT = CONFIG.level[getPlayerSkillLevel(cid, 7)] if not EVENT then return false end for i, v in ipairs(EVENT) do text = text..""..i..", " end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "New spells: "..text.."") end return true end
Postado Setembro 29, 2015 9 anos Autor Acho que isso resolve: local spells = { [1] = { --sorcerer level = { [1] = "utevo lux", "exura", "adori", [40] = "exevo gran mas vis" } }, [2] = { --druid level = { [1] = "utevo lux", "exura", "adori", [28] = "exevo gran mas pox" } }, [3] = { --paladin level = { [1] = "utevo lux", "exura", "exevo con", [14] = "exevo con vis" } }, [4] = { --knight level = { [1] = "utevo lux", "exura", [5] = "exori" } } } local array_sorc = {"Sorcerer", "Master Sorcerer", "Epic Sorcerer"} local array_druid = {"Druid", "Elder Druid", "Epic Druid"} local array_paladin = {"Paladin", "Royal Paladin", "Epic Paladin"} local array_knight = {"Knight", "Elite Knight", "Epic Knight"} local text = "" function onAdvance(cid, skill, oldLevel, newLevel) if skill == SKILL__MAGLEVEL then if isInArray(array_sorc, getPlayerVocationName(cid)) then CONFIG = spells[1] elseif isInArray(array_druid, getPlayerVocationName(cid)) then CONFIG = spells[2] elseif isInArray(array_paladin, getPlayerVocationName(cid)) then CONFIG = spells[3] elseif isInArray(array_knight, getPlayerVocationName(cid)) then CONFIG = spells[4] end if not CONFIG then return false end EVENT = CONFIG.level[getPlayerSkillLevel(cid, 7)] if not EVENT then return false end for i, v in ipairs(EVENT) do text = text..""..i..", " end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "New spells: "..text.."") end return true end De novo rodou sem erros, mas na hora de executar, peguei ml de 5 ao 80 num sorcerer e nenhuma mensagem foi mostrada... Alguém sabe corrigir esse script ou fazer com que o outro rode em meu servidor?
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.