Postado Novembro 20, 2014 10 anos CARA VOCÊ É DEMAIS !!! TESTEI AQUI NO MEU 8.6 FUNCIONOU DIREITINHO. VLW MANO <3 Receba seu REP+ ai !
Postado Novembro 20, 2014 10 anos Belo script, só poderia ser mais resumido, tipo assim: local cfg = { [0] = {m = {lookType = 136}, f = {lookType = 128}, storage = 1415} [1] = {m = {lookType = 138}, f = {lookType = 130}, storage = 1417} --[VocationID] = {m(masculino) = {lookType = 138}, f(feminino)= {lookType = 130}, storage = 1417} } function onLogin(cid) local r = getCreatureOutfit(cid) local roupa = {lookHead = r.lookHead, lookBody = r.lookBody, lookLegs = r.lookLegs , lookFeet = r.lookFeet} if (getPlayerAccess(cid) <= 2) then for i = 0, #cfg do if getPlayerVocation(cid) == i then if getPlayerSex(cid) == 1 and getPlayerStorageValue(cid, cfg.storage) < 1 then doCreatureChangeOutfit(cid,{cfg.m, roupa}) else doCreatureChangeOutfit(cid, {cfg.f, roupa}) end setPlayerStorageValue(cid, cfg.storage, 1) end end return true end Além de ter uma configuração mais fácil Aliás você fez uma verificação de que é player, por que? Agora não sei se precisa ou não Editado Novembro 20, 2014 10 anos por mateusak (veja o histórico de edições) Não se esqueça de dar REP+ para quem te ajudou e caso seja a solução marcar como melhor resposta! NÃO CLIQUE AQUI! NEM AQUI! ________________________________________________________________________________________________________________________________________________________________________________________________________________________ “A imaginação é mais importante que o conhecimento.” Albert Einstein
Postado Novembro 22, 2014 10 anos Autor @mateusak, incrivelmente as vezes pode bugar por não fazer a verificação do player. Esse seu até funciona, mas o meu eu consigo adaptar para mais funções que uso em meu servidor.
Postado Novembro 26, 2014 10 anos Boa noite, meus amigos! Finalmente consegui montar um servidor 10.31 e fazer o servidor rodar com este script. Entretanto, apesar de eu colocar o script tudo perfeitamente, apenas uma vocação está ficando com o Looktype que designei, a Dwarf. Poderia me ajudar? Seguem os scripts: outfit.lua function onLogin(cid) local r = getCreatureOutfit(cid) local roupa = {lookHead = r.lookHead, lookBody = r.lookBody, lookLegs = r.lookLegs , lookFeet = r.lookFeet} if (getPlayerAccess(cid) <= 2) then if isPlayer(cid) then if getPlayerStorageValue(cid, 1415) == -1 then if getPlayerVocation(cid) == 1 then -- Druid setPlayerStorageValue(cid,1415 ,1) -- Druid if getPlayerSex(cid) == 0 then -- Se for homem doCreatureChangeOutfit(cid,{lookType = 136, roupa}) -- Roupa Masculina else doCreatureChangeOutfit(cid, {lookType = 128, roupa}) -- Roupa Feminina end end end if getPlayerStorageValue(cid, 1416) == -1 then if getPlayerVocation(cid) == 2 then -- Elf setPlayerStorageValue(cid,1416 ,1) -- Elf if getPlayerSex(cid) == 0 then -- Se for homem doCreatureChangeOutfit(cid,{lookType = 159, roupa}) -- Roupa Masculina else doCreatureChangeOutfit(cid, {lookType = 159, roupa}) -- Roupa Feminina end end end if getPlayerStorageValue(cid, 1417) == -1 then if getPlayerVocation(cid) == 3 then -- Wizard setPlayerStorageValue(cid,1417 ,1) -- Wizard if getPlayerSex(cid) == 0 then -- Se for homem doCreatureChangeOutfit(cid,{lookType = 138, roupa}) -- Roupa Masculina else doCreatureChangeOutfit(cid, {lookType = 130, roupa}) -- Roupa Feminina end end end if getPlayerStorageValue(cid, 1418) == -1 then if getPlayerVocation(cid) == 4 then -- Dwarf setPlayerStorageValue(cid,1418 ,1) -- Dwarf if getPlayerSex(cid) == 0 then -- Se for homem doCreatureChangeOutfit(cid,{lookType = 160, roupa}) -- Roupa Masculina else doCreatureChangeOutfit(cid, {lookType = 160, roupa}) -- Roupa Feminina end end end end end return true end vocations.xml <?xml version="1.0"?> <outfits> <outfit id="1" storageId="1415" storageValue="1"> <list gender="0" lookType="136" name="Druid"/> <list gender="1" lookType="128" name="Druid"/> </outfit> <outfit id="2" storageId="1416" storageValue="1"> <list gender="0" lookType="159" name="Elf"/> <list gender="1" lookType="159" name="Elf"/> </outfit> <outfit id="3" storageId="1417" storageValue="1"> <list gender="0" lookType="138" name="Wizard"/> <list gender="1" lookType="130" name="Wizard"/> </outfit> <outfit id="4" storageId="1418" storageValue="1"> <list gender="0" lookType="160" name="Dwarf"/> <list gender="1" lookType="160" name="Dwarf"/> </outfit> <outfit id="35" access="3"> <list gender="0-3" lookType="75" name="Gamemaster"/> </outfit> <outfit id="36" access="4"> <list gender="0-3" lookType="266" name="Community Manager"/> </outfit> <outfit id="37" access="5"> <list gender="0-3" lookType="302" name="God"/> </outfit> </outfits> ATUALIZAÇÃO Pode deixar, moçada! Descobri o que era: As ids dos outfits não estavam de acordo com as ids das vocations (outfits.xml; vocations.xml). Obrigado de qualquer forma! -------------------------------------- Aproveitando o post: Ka zuza, você conseguiria colocar uma condição nesse script de por exemplo: Knight tem acesso apenas ao outfit 1, porém se ele for promoted, ele possui acesso aos outfits 1 e 5. Consegue? Editado Novembro 26, 2014 10 anos por Strongalo (veja o histórico de edições)
Postado Novembro 28, 2014 10 anos Autor É bem facil, só ponha a storage correspondente: Ex: if getPlayerStorageValue(cid, 1417) == -1 then if getPlayerVocation(cid) == 3 then -- Wizard setPlayerStorageValue(cid,1417 ,1) -- Wizard setPlayerStorageValue(cid,1418 ,1) -- Wizard Promovido <---- EXEMPLO if getPlayerSex(cid) == 0 then -- Se for homem doCreatureChangeOutfit(cid,{lookType = 138, roupa}) -- Roupa Masculina else doCreatureChangeOutfit(cid, {lookType = 130, roupa}) -- Roupa Feminina end end end
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.