Ir para conteúdo

Featured Replies

  • Respostas 5
  • Visualizações 3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Cara, não sei se vai funcionar, mas eu fiz aqui correndo...   Seguinte, cria um novo .lua em talkations/scripts e add: function onSay(cid, words, param, param2) if(words == "/addmount") then

  • nunca mexi com sistema de montaria e nem com essas versões mais novas de tibia mas acredito que seja só adaptar esse script aqui http://www.tibiaking.com/forum/topic/17243-resolvidopedido-sistema-moun

Postado

nunca mexi com sistema de montaria e nem com essas versões mais novas de tibia mas acredito que seja só adaptar esse script aqui
http://www.tibiaking.com/forum/topic/17243-resolvidopedido-sistema-mounts/
boa sorte pra você ou pra quem for tentar te ajudar

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado

Cara, não sei se vai funcionar, mas eu fiz aqui correndo...

 

Seguinte, cria um novo .lua em talkations/scripts e add:

function onSay(cid, words, param, param2)

if(words == "/addmount") then 
         if getPlayerAccess(cid) == 5 then 
            local t = string.explode(param, ",") 
            if not t[2] then 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") 
         end 
 
 local player = getPlayerByName(t[1]) 
 local name = getCreatureName(player) 
 local pid = getPlayerByNameWildcard(t[1]) 
       if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then 
              doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") 
              return TRUE 
       end 
 
 local storageplayer = getPlayerStorageValue(player, mount2.str) 

       if(storageplayer >= 1) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player already have this mount.")
                        elseif(storageplayer <= 0) then
                           doPlayerAddMount(cid, mount2.id)
                           doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                           doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. " has received the mount ")
                           setPlayerStorageValue(player, mount2.str, 1)
                        end
       end
end
end

no talkations.xml adicione:

<talkaction words="/addmount" event="script" value="addmount.lua"/>

Mude apenas o nome do arquivo.

 

Para utilizar in game, escreva:

 

/addmount nomeDoPlayer IDdaMount

 

Agora, para funcionar deverá modificar o código do link que nosso amigo xWhiteWolf acima o enviou... mudando o código para:

local montConfig =
{
['widow queen'] = {item = xx, id = 1, str = 2001},
['racing bird'] = {item = xx, id = 2, str = 2002},
['war bear'] = {item = xx, id = 3, str = 2003},
['black sheep'] = {item = xx, id = 4, str = 2004},
['midnight panther'] = {item = xx, id = 5, str = 2005},
['draptor'] = {item = xx, id = 6, str = 2006},
['titanica'] = {item = xx, id = 7, str = 2007},
['tin lizard'] = {item = xx, id = 8, str = 2008},
['blazebringer'] = {item = xx, id = 9, str = 2009},
['rapid boar'] = {item = xx, id = 10, str = 2010},
['stampor'] = {item = xx, id = 11, str = 2011},
['undead cavebear'] = {item = xx, id = 12, str = 2012}
}
local xx = 3954 --- id do item
function onSay(cid, words, param)
if(param == '') then
local str = ""
for name, options in pairs(montConfig) do
str = str .. "\n" .. name
end

doPlayerPopupFYI(cid, "List of mounts:\n\n" .. str)
return true
end

local mount = montConfig[param]
if(mount ~= nil) then
if doPlayerRemoveItem(cid,mount.item,1) then
doPlayerSendCancel(cid, "Sorry, you dont have a mont doll for buy this mont " .. param .. "")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return true
end

doPlayerAddMount(cid, mount.id)
doPlayerRemoveItem(cid, xx,1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
else
doPlayerSendCancel(cid, "The mount not found in list. Please use '!mount' to see the mounts list.")
end
return true
end

Note que apenas adicionei str = valor em cada linha, mude os numeros 2001,2002 até 2012 para numeros de storage válidos em seu servidor.

 

Feito isso, salve e reinicie seu servidor.

Agora é só utilizar. Posta ai se funcionou =)

 

Se possível, +REP

-GstavoLiber

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo