Postado Julho 24, 2016 8 anos Bom isso seria facil resolver mais estou voltando agora após mais 1 ano parado, ao criar o char ele não recebe os items vou postar o script tanto do /mod quanto do data\creaturescripts\scripts. Peguei o servidor para relembrar edições básicas pois estou a recomeçar um projeto antigo. Esse e o /mod <?xml version="1.0" encoding="UTF-8"?> <mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes"> <config name="firstitems_config"><![CDATA[ config = { storage = 30001, items = {2050, 2382} } ]]></config> <event type="login" name="FirstItems" event="script"> <![CDATA[ domodlib('firstitems_config') function onLogin(cid) local commonItems = { -- ITEMS ALL VOCS RECEIVE {itemid=2120, count=1}, -- rope {itemid=5710, count=1}, -- shovel {itemid=2420, count=1}, -- machete {itemid=2789, count=100}, -- brown mushrooms {itemid=2305, count=1}, -- fire bomb rune {itemid=2261, count=1}, -- destroy field rune } local firstItems = { { -- SORC ITEMS {itemid=9778, count=1}, -- {itemid=8871, count=1}, -- focus cape {itemid=7894, count=1}, -- {itemid=2195, count=1}, -- boots of haste {itemid=8918, count=1}, -- {itemid=8922, count=1}, -- {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=7590, count=1}, -- gmp {itemid=2293, count=1}, -- mw }, { -- DRUID ITEMS {itemid=9778, count=1}, -- {itemid=8871, count=1}, -- focus cape {itemid=7894, count=1}, -- {itemid=2195, count=1}, -- boots of haste {itemid=8918, count=1}, -- {itemid=8910, count=1}, -- hailstorm rod {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=7590, count=1}, -- gmp {itemid=2293, count=1}, -- mw {itemid=2269, count=1}, -- wg {itemid=2278, count=1}, -- para }, { -- PALADIN ITEMS {itemid=2493, count=1}, -- demon helmet {itemid=8888, count=1}, -- paladin armor {itemid=2470, count=1}, -- blue legs {itemid=2195, count=1}, -- boots of haste {itemid=8851, count=1}, -- mastermind shield {itemid=6529, count=1}, -- assassin stars {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=8472, count=1}, -- gsp {itemid=7589, count=1}, -- smp {itemid=7588, count=1}, -- shp {itemid=2293, count=1}, -- mw }, { -- KNIGHT ITEMS {itemid=2493, count=1}, -- demon helmet {itemid=8882, count=1}, -- magic plate armor {itemid=2470, count=1}, -- golden legs {itemid=2195, count=1}, -- boots of haste {itemid=6391, count=1}, -- mastermind shield {itemid=8925, count=1}, -- magic sword {itemid=7620, count=1}, -- mp {itemid=7591, count=1}, -- ghp {itemid=8473, count=1}, -- uhp {itemid=2313, count=1}, -- explosion {itemid=2293, count=1}, -- mw } } for _, items in ipairs(firstItems) do for _, item in ipairs(commonItems) do table.insert(items, item) end end if getPlayerGroupId(cid) < 2 then local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708) if hasReceivedFirstItems == -1 then --[[local backpack = ]]doPlayerAddItem(cid, 1988, 1) local giveItems = firstItems[getPlayerVocation(cid)] if giveItems ~= nil then for _, v in ipairs(giveItems) do --doAddContainerItem(backpack, v.itemid, v.count or 1) doPlayerAddItem(cid, v.itemid, v.count or 1) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Website: http://bigwar.sytes.net") setPlayerStorageValue(cid, 67708, 1) end end end return TRUE end ]]></event> </mod> Esse abaixo seria o data\creaturescripts\scripts local commonItems = { -- ITEMS ALL VOCS RECEIVE {itemid=2120, count=1}, -- rope {itemid=5710, count=1}, -- shovel {itemid=2420, count=1}, -- machete {itemid=2789, count=100}, -- brown mushrooms {itemid=2305, count=1}, -- fire bomb rune {itemid=2261, count=1}, -- destroy field rune } local firstItems = { { -- SORC ITEMS {itemid=9778, count=1}, -- {itemid=8871, count=1}, -- focus cape {itemid=7894, count=1}, -- {itemid=2195, count=1}, -- boots of haste {itemid=8918, count=1}, -- {itemid=8922, count=1}, -- {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=7590, count=1}, -- gmp {itemid=2293, count=1}, -- mw }, { -- DRUID ITEMS {itemid=9778, count=1}, -- {itemid=8871, count=1}, -- focus cape {itemid=7894, count=1}, -- {itemid=2195, count=1}, -- boots of haste {itemid=8918, count=1}, -- {itemid=8910, count=1}, -- hailstorm rod {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=7590, count=1}, -- gmp {itemid=2293, count=1}, -- mw {itemid=2269, count=1}, -- wg {itemid=2278, count=1}, -- para }, { -- PALADIN ITEMS {itemid=2493, count=1}, -- demon helmet {itemid=8888, count=1}, -- paladin armor {itemid=2470, count=1}, -- blue legs {itemid=2195, count=1}, -- boots of haste {itemid=8851, count=1}, -- mastermind shield {itemid=6529, count=1}, -- assassin stars {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=8472, count=1}, -- gsp {itemid=7589, count=1}, -- smp {itemid=7588, count=1}, -- shp {itemid=2293, count=1}, -- mw }, { -- KNIGHT ITEMS {itemid=2493, count=1}, -- demon helmet {itemid=8882, count=1}, -- magic plate armor {itemid=2470, count=1}, -- golden legs {itemid=2195, count=1}, -- boots of haste {itemid=6391, count=1}, -- mastermind shield {itemid=8925, count=1}, -- magic sword {itemid=7620, count=1}, -- mp {itemid=7591, count=1}, -- ghp {itemid=8473, count=1}, -- uhp {itemid=2313, count=1}, -- explosion {itemid=2293, count=1}, -- mw } } for _, items in ipairs(firstItems) do for _, item in ipairs(commonItems) do table.insert(items, item) end end function onLogin(cid) if getPlayerGroupId(cid) < 2 then local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708) if hasReceivedFirstItems == -1 then --[[local backpack = ]]doPlayerAddItem(cid, 1988, 1) local giveItems = firstItems[getPlayerVocation(cid)] if giveItems ~= nil then for _, v in ipairs(giveItems) do --doAddContainerItem(backpack, v.itemid, v.count or 1) doPlayerAddItem(cid, v.itemid, v.count or 1) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Website: http://megawar.no-ip.org") setPlayerStorageValue(cid, 67708, 1) end end end return TRUE end Trinity Games inovação em Servidores privados http://trinitygames.com.br https://www.youtube.com/user/mrcreu10
Postado Julho 24, 2016 8 anos Solução @misternis Tente assim: Na pasta Mods crie um arquivo chamado firstitems.xml e adicione: Spoiler <?xml version="1.0" encoding="UTF-8"?> <mod name="First Items" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes"> <config name="firstitems_config"><![CDATA[ config = { storage = 30001, items = {2050, 2382} } ]]></config> <event type="login" name="FirstItems" event="script"> <![CDATA[ domodlib('firstitems_config') function onLogin(cid) local commonItems = { -- ITEMS ALL VOCS RECEIVE {itemid=2120, count=1}, -- rope {itemid=5710, count=1}, -- shovel {itemid=2420, count=1}, -- machete {itemid=2789, count=100}, -- brown mushrooms {itemid=2305, count=1}, -- fire bomb rune {itemid=2261, count=1}, -- destroy field rune } local firstItems = { { -- SORC ITEMS {itemid=9778, count=1}, -- {itemid=8871, count=1}, -- focus cape {itemid=7894, count=1}, -- {itemid=2195, count=1}, -- boots of haste {itemid=8918, count=1}, -- {itemid=8922, count=1}, -- {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=7590, count=1}, -- gmp {itemid=2293, count=1}, -- mw }, { -- DRUID ITEMS {itemid=9778, count=1}, -- {itemid=8871, count=1}, -- focus cape {itemid=7894, count=1}, -- {itemid=2195, count=1}, -- boots of haste {itemid=8918, count=1}, -- {itemid=8910, count=1}, -- hailstorm rod {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=7590, count=1}, -- gmp {itemid=2293, count=1}, -- mw {itemid=2269, count=1}, -- wg {itemid=2278, count=1}, -- para }, { -- PALADIN ITEMS {itemid=2493, count=1}, -- demon helmet {itemid=8888, count=1}, -- paladin armor {itemid=2470, count=1}, -- blue legs {itemid=2195, count=1}, -- boots of haste {itemid=8851, count=1}, -- mastermind shield {itemid=6529, count=1}, -- assassin stars {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=8472, count=1}, -- gsp {itemid=7589, count=1}, -- smp {itemid=7588, count=1}, -- shp {itemid=2293, count=1}, -- mw }, { -- KNIGHT ITEMS {itemid=2493, count=1}, -- demon helmet {itemid=8882, count=1}, -- magic plate armor {itemid=2470, count=1}, -- golden legs {itemid=2195, count=1}, -- boots of haste {itemid=6391, count=1}, -- mastermind shield {itemid=8925, count=1}, -- magic sword {itemid=7620, count=1}, -- mp {itemid=7591, count=1}, -- ghp {itemid=8473, count=1}, -- uhp {itemid=2313, count=1}, -- explosion {itemid=2293, count=1}, -- mw } } for _, items in ipairs(firstItems) do for _, item in ipairs(commonItems) do table.insert(items, item) end end if getPlayerGroupId(cid) < 2 then local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708) if hasReceivedFirstItems == -1 then --[[local backpack = ]]doPlayerAddItem(cid, 1988, 1) local giveItems = firstItems[getPlayerVocation(cid)] if giveItems ~= nil then for _, v in ipairs(giveItems) do --doAddContainerItem(backpack, v.itemid, v.count or 1) doPlayerAddItem(cid, v.itemid, v.count or 1) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Website: http://bigwar.sytes.net") setPlayerStorageValue(cid, 67708, 1) end end end return TRUE end ]]></event> </mod> Agora em Data/Creaturescripts/script crie um arquivo chamado firstitens.lua e adicione: Spoiler local commonItems = { -- ITEMS ALL VOCS RECEIVE {itemid=2120, count=1}, -- rope {itemid=2160, count=1}, -- cristal coin {itemid=5710, count=1}, -- shovel {itemid=2420, count=1}, -- machete {itemid=2789, count=100}, -- brown mushrooms {itemid=2305, count=1}, -- fire bomb rune {itemid=2261, count=1}, -- destroy field rune } local firstItems = { { -- SORC ITEMS {itemid=2323, count=1}, -- hat of the mad {itemid=8871, count=1}, -- focus cape {itemid=7730, count=1}, -- blue legs {itemid=2195, count=1}, -- boots of haste {itemid=8902, count=1}, -- spellbook of mind control {itemid=2187, count=1}, -- wand of inferno {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=7590, count=1}, -- gmp {itemid=2293, count=1}, -- mw }, { -- DRUID ITEMS {itemid=2323, count=1}, -- hat of the mad {itemid=8871, count=1}, -- focus cape {itemid=7730, count=1}, -- blue legs {itemid=2195, count=1}, -- boots of haste {itemid=8902, count=1}, -- spellbook of mind control {itemid=2183, count=1}, -- hailstorm rod {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=7590, count=1}, -- gmp {itemid=2293, count=1}, -- mw {itemid=2269, count=1}, -- wg {itemid=2278, count=1}, -- para }, { -- PALADIN ITEMS {itemid=2493, count=1}, -- demon helmet {itemid=8891, count=1}, -- paladin armor {itemid=7730, count=1}, -- blue legs {itemid=2195, count=1}, -- boots of haste {itemid=2514, count=1}, -- mastermind shield {itemid=7368, count=10}, -- assassin stars {itemid=2268, count=1}, -- sd {itemid=2273, count=1}, -- uh {itemid=8472, count=1}, -- gsp {itemid=7589, count=1}, -- smp {itemid=7588, count=1}, -- shp {itemid=2293, count=1}, -- mw }, { -- KNIGHT ITEMS {itemid=2493, count=1}, -- demon helmet {itemid=2472, count=1}, -- magic plate armor {itemid=2470, count=1}, -- golden legs {itemid=2195, count=1}, -- boots of haste {itemid=2514, count=1}, -- mastermind shield {itemid=2400, count=1}, -- magic sword {itemid=2431, count=1}, -- Stonecutter Axe {itemid=7620, count=1}, -- mp {itemid=7591, count=1}, -- ghp {itemid=8473, count=1}, -- uhp {itemid=2313, count=1}, -- explosion {itemid=2293, count=1}, -- mw } } for _, items in ipairs(firstItems) do for _, item in ipairs(commonItems) do table.insert(items, item) end end function onLogin(cid) if getPlayerGroupId(cid) < 2 then local hasReceivedFirstItems = getPlayerStorageValue(cid, 67708) if hasReceivedFirstItems == -1 then --[[local backpack = ]]doPlayerAddItem(cid, 1988, 1) local giveItems = firstItems[getPlayerVocation(cid)] if giveItems ~= nil then for _, v in ipairs(giveItems) do --doAddContainerItem(backpack, v.itemid, v.count or 1) doPlayerAddItem(cid, v.itemid, v.count or 1) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved your equipment") setPlayerStorageValue(cid, 67708, 1) end end end return TRUE end Agora, em creaturescripts.xml adicione: <event type="login" name="FirstItems" event="script" value="firstitems.lua"/> Tente aí! Obs: Se lhe ajudei de um REP+ Aí !
Postado Julho 24, 2016 8 anos Autor @Mathwsz Segui todos os seus passos mais esta dando esse erro: -|| Mix Soft, version: 1.0.0, codename: (Protocolo 8.60). Distro TCS modificado. Servidor com base TFS. Mix Soft - RenanSdc - Bond - Saymon. Visite nosso blog: http://mix-yourots.blogspot.com >> Loading config (config.lua) > Using plaintext encryption >> Loading RSA key >> Starting SQL connection >> Running Database Manager > Optimized database. >> Loading items >> Loading groups >> Loading vocations >> Loading script systems data/creaturescripts/creaturescripts.xml:25: parser error : Extra content at the end of the document <event type="login" name="FirstItems" event="script" value="firstItems.lua"/> ^ [Warning - BaseEvents::loadFromXml] Cannot open creaturescripts.xml file. Line: 25, Info: Extra content at the end of the document > ERROR: Unable to load CreatureEvents! Trinity Games inovação em Servidores privados http://trinitygames.com.br https://www.youtube.com/user/mrcreu10
Postado Julho 24, 2016 8 anos @misternis não se esquece de registrar no login.lua , amigo. Meu servidor https://www.facebook.com/Heavennoobwar
Postado Julho 24, 2016 8 anos Autor TÓPICO RESOLVIDO, AGRADEÇO A TODOS GRAÇAS A ISSO ME LEMBREI JA DE VÁRIOS DETALHES IMPORTANTES Trinity Games inovação em Servidores privados http://trinitygames.com.br https://www.youtube.com/user/mrcreu10
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.