Postado Setembro 6, 2020 4 anos @Belmont Nenhum erro no terminal. Somente o gold está recolhendo, está indo para o banco.. não sabia, mas de alguma forma está bugando.. Falo com o npc para retirar a quantia, ele me "entrega" não vem para o inventário, e no banco a quantia fica a mesma. 13:07 BankMan: Your balance are 210058 golds. 13:08 BankMan: Please tell me how much gold you would like to withdraw. 13:08 Diarmaint [100]: 10000 13:08 BankMan: Do you want withdraw 10000 golds ? 13:08 Diarmaint [100]: yes 13:08 BankMan: Here you are, 10000 gold. Now your balance account is 210058 golds. Também não consigo depositar, ele dá a mensagem que depositou, mas o gold não sai do meu inventário. 13:14 Diarmaint [100]: deposit 13:14 BankMan: Please tell me how much gold it is you would like to deposit. 13:14 Diarmaint [100]: 50000 13:14 BankMan: Do you want deposit 50000 golds ? 13:14 Diarmaint [100]: yes 13:14 BankMan: Sucessfull. Now your balance account is 210058 golds. Editado Setembro 6, 2020 4 anos por diarmaint (veja o histórico de edições)
Postado Setembro 6, 2020 4 anos Autor Em 06/09/2020 em 16:13, diarmaint disse: @Belmont Nenhum erro no terminal. Somente o gold está recolhendo, está indo para o banco.. não sabia, mas de alguma forma está bugando.. Falo com o npc para retirar a quantia, ele me "entrega" não vem para o inventário, e no banco a quantia fica a mesma. 13:07 BankMan: Your balance are 210058 golds. 13:08 BankMan: Please tell me how much gold you would like to withdraw. 13:08 Diarmaint [100]: 10000 13:08 BankMan: Do you want withdraw 10000 golds ? 13:08 Diarmaint [100]: yes 13:08 BankMan: Here you are, 10000 gold. Now your balance account is 210058 golds. Também não consigo depositar, ele dá a mensagem que depositou, mas o gold não sai do meu inventário. 13:14 Diarmaint [100]: deposit 13:14 BankMan: Please tell me how much gold it is you would like to deposit. 13:14 Diarmaint [100]: 50000 13:14 BankMan: Do you want deposit 50000 golds ? 13:14 Diarmaint [100]: yes 13:14 BankMan: Sucessfull. Now your balance account is 210058 golds. Verifica se no seu config.lua já tem essa função registrada: bankSystem = true, se não tiver adicione. Caso isso não baste, tenta usar esse script do NPC Banker: XML: Mostrar conteúdo oculto <?xml version="1.0" encoding="UTF-8"?> <npc name="Banker" script="data/npc/scripts/bank.lua" walkinterval="2000" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="132" head="115" body="0" legs="114" feet="0" addons="3" corpse="2212"/> <parameters> <parameter key="message_greet" value="Welcome |PLAYERNAME|! Here, you can {deposit}, {withdraw} or {transfer} your money from your bank account. I can change your coins too."/> <parameter key="message_alreadyfocused" value="You are drunked ? I talk with you."/> <parameter key="message_farewell" value="Goodbye. I wanna see your money... oh you again."/> </parameters> </npc> .Lua: Mostrar conteúdo oculto local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local moneyTo = {} local playerTo = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end local function isValidMoney(money) if isNumber(money) == TRUE and money > 0 and money < 999999999 then return TRUE end return FALSE end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'help') or msgcontains(msg, 'offer') then selfSay("You can check the {balance} of your bank account, {deposit} money or {withdraw} it. You can also {transfer} money to other characters, provided that they have a vocation.", cid) talkState[cid] = 0 ----------------------------------------------------------------- ---------------------------- Balance ---------------------------- ----------------------------------------------------------------- elseif msgcontains(msg, 'balance') or msgcontains(msg, 'Balance') then selfSay('Your account balance is '..getPlayerBalance(cid)..' gold.', cid) talkState[cid] = 0 ----------------------------------------------------------------- ---------------------------- Help ------------------------------- ----------------------------------------------------------------- elseif msgcontains(msg, 'basic functions') then selfSay('You can check the {balance{ of your bank account, Pdeposit{ money or Pwithdraw{ it. You can also {transfer} money to othercharacters, provided that they have a vocation.', cid) talkState[cid] = 0 elseif msgcontains(msg, 'advanced functions') then selfSay('Renting a house has never been this easy. Simply make a bid for an auction. We will check immediately if you haveenough money.', cid) talkState[cid] = 0 ----------------------------------------------------------------- ---------------------------- Deposit ---------------------------- ----------------------------------------------------------------- elseif msgcontains(msg, 'deposit all') then moneyTo[cid] = getPlayerMoney(cid) if moneyTo[cid] < 1 then selfSay('You don\'t have any money to deposit in you inventory..', cid) talkState[cid] = 0 else selfSay('Would you really like to deposit '..moneyTo[cid]..' gold?', cid) talkState[cid] = 2 end elseif msgcontains(msg, 'deposit') then selfSay("Please tell me how much gold it is you would like to deposit.", cid) talkState[cid] = 1 elseif talkState[cid] == 1 then moneyTo[cid] = tonumber(msg) if isValidMoney(moneyTo[cid]) == TRUE then selfSay('Would you really like to deposit '..moneyTo[cid]..' gold?', cid) talkState[cid] = 2 else selfSay('Is isnt valid amount of gold to deposit.', cid) talkState[cid] = 0 end elseif talkState[cid] == 2 then if msgcontains(msg, 'yes') then if doPlayerDepositMoney(cid, moneyTo[cid], 1) ~= TRUE then selfSay('You do not have enough gold.', cid) else selfSay('Alright, we have added the amount of '..moneyTo[cid]..' gold to your balance. You can withdraw your money anytime you want to. Your account balance is ' .. getPlayerBalance(cid) .. '.', cid) end elseif msgcontains(msg, 'no') then selfSay('As you wish. Is there something else I can do for you?', cid) end talkState[cid] = 0 ----------------------------------------------------------------- ---------------------------- Withdraw --------------------------- ----------------------------------------------------------------- elseif msgcontains(msg, 'withdraw') then selfSay("Please tell me how much gold you would like to withdraw.", cid) talkState[cid] = 6 elseif talkState[cid] == 6 then moneyTo[cid] = tonumber(msg) if isValidMoney(moneyTo[cid]) == TRUE then selfSay('Are you sure you wish to withdraw '..moneyTo[cid]..' gold from your bank account?', cid) talkState[cid] = 7 else selfSay('Is isnt valid amount of gold to withdraw.', cid) talkState[cid] = 0 end elseif talkState[cid] == 7 then if msgcontains(msg, 'yes') then if doPlayerWithdrawMoney(cid, moneyTo[cid]) ~= TRUE then selfSay('There is not enough gold on your account. Your account balance is '..getPlayerBalance(cid)..'. Please tell me the amount of gold coins you would like to withdraw.', cid) else selfSay('Here you are, ' .. moneyTo[cid] .. ' gold. Please let me know if there is something else I can do for you.', cid) talkState[cid] = 0 end elseif msgcontains(msg, 'no') then selfSay('As you wish. Is there something else I can do for you?', cid) talkState[cid] = 0 end ----------------------------------------------------------------- ---------------------------- Transfer --------------------------- ----------------------------------------------------------------- elseif msgcontains(msg, 'transfer') then selfSay("Please tell me the amount of gold you would like to transfer.", cid) talkState[cid] = 11 elseif talkState[cid] == 11 then moneyTo[cid] = tonumber(msg) if isValidMoney(moneyTo[cid]) == TRUE then selfSay('Who would you like transfer '..moneyTo[cid]..' gold to?', cid) talkState[cid] = 12 else selfSay('Is isnt valid amount of gold to transfer.', cid) talkState[cid] = 0 end elseif talkState[cid] == 12 then playerTo[cid] = msg if getCreatureName(cid) == playerTo[cid] then selfSay('Ehm, You want transfer money to yourself? Its impossible!', cid) talkState[cid] = 0 return TRUE end if playerExists(playerTo[cid]) then selfSay('So you would like to transfer ' .. moneyTo[cid] .. ' gold to "' .. playerTo[cid] .. '" ?', cid) talkState[cid] = 13 else selfSay('Player with name "' .. playerTo[cid] .. '" doesnt exist.', cid) talkState[cid] = 0 end elseif talkState[cid] == 13 then if msgcontains(msg, 'yes') then if getPlayerBalance(cid) < moneyTo[cid] then selfSay('You dont have enought money on your bank account.', cid) return TRUE end if doPlayerTransferMoneyTo(cid, playerTo[cid], moneyTo[cid]) ~= TRUE then selfSay('This player does not exist on this world or have no vocation.', cid) else selfSay('You have transferred ' .. moneyTo[cid] .. ' gold to "' .. playerTo[cid] ..' ".', cid) playerTo[cid] = nil end elseif msgcontains(msg, 'no') then selfSay('As you wish. Is there something else I can do for you?', cid) end talkState[cid] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Meu Curso sobre Programação para OTServer Programando OTServer Peça o seu script! Entre agora mesmo no grupo Developing Conteúdos: Mostrar conteúdo oculto • Cidade [8.60] • Cave de Boss • Widget Gesior • Autoloot 100% • [Old Client] Como Hookar Dll • Configurando VPS Windowns • [Solução] Código Caracteres Especiais Discord: Belmont#7352 Não esqueça do REP+
Postado Setembro 6, 2020 4 anos @Belmont Adicionei a função bankSystem no config agora o npc funciona corretamente, ao coletar o gold ele vai para o banco e consigo retirar tudo certo. Mas o essencial ainda não funciona, que é a coleta de itens, não sei aonde está o problema, nenhum erro acontece, apenas não pega os itens. estou usando o ntohard de teste, pensei que o problema poderia ser os monstros, pois não dropar o corpo quando morrem e sim uma bag, mas a bag é corpse então não sei aonde está o erro. Editado Setembro 6, 2020 4 anos por diarmaint (veja o histórico de edições)
Postado Setembro 6, 2020 4 anos Autor Em 06/09/2020 em 18:53, diarmaint disse: @Belmont Adicionei a função bankSystem no config agora o npc funciona corretamente, ao coletar o gold ele vai para o banco e consigo retirar tudo certo. Mas o essencial ainda não funciona, que é a coleta de itens, não sei aonde está o problema, nenhum erro acontece, apenas não pega os itens. estou usando o ntohard de teste, pensei que o problema poderia ser os monstros, pois não dropar o corpo quando morrem e sim uma bag, mas a bag é corpse então não sei aonde está o erro Vou verificar aqui, eu tenho a base dele também qualquer coisa se eu resolver eu te falo. Você está usando a source que foi disponibilizada junto com a base, ou está usando outra? Meu Curso sobre Programação para OTServer Programando OTServer Peça o seu script! Entre agora mesmo no grupo Developing Conteúdos: Mostrar conteúdo oculto • Cidade [8.60] • Cave de Boss • Widget Gesior • Autoloot 100% • [Old Client] Como Hookar Dll • Configurando VPS Windowns • [Solução] Código Caracteres Especiais Discord: Belmont#7352 Não esqueça do REP+
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.