Postado Dezembro 10, 2012 12 anos É bem isso mesmo que está no título que eu gostaria de ter. Um sistema de bank por comando, por exemplo: !deposit 100 - Depositaria 100 golds "na conta do char" !withdraw 100 - Retiraria 100 golds "da conta do char" e também !balance - para ver quanto de gold há no "bank" Se possível também seria bom se tivesse !deposit all e !withdraw all - Para não ficar tendo que contar certinho para depositar/retirar. Se alguém tiver esse script que funcione dou-lhe REP+ eu já procurei em varios lugares e não achei um funcional, todos que eu achei , quando uso o comando não acontece nada, não da erro nem nada. Obrigado e Aguardo...
Postado Dezembro 10, 2012 12 anos <?xml version="1.0" encoding="UTF-8"?> <mod name="command-bank" version="1.0" author="slawkens" contact="[email protected]" enabled="yes"> <config name="command-bank-config"><![CDATA[ transferDisabledVocations = {0} -- disable non vocation characters ]]></config> <talkaction words="!bank" event="script"><![CDATA[ domodlib('command-bank-config') local config = { transferDisabledVocations = transferDisabledVocations } local function validAmount(amount) return (isNumber(amount) and amount > 0 and amount < 4294967296) end local function getAmount(amount, cid, f) return (amount == 'all' and f(cid) or tonumber(amount)) end local function getPlayerVocationByName(name) local result = db.getResult("SELECT `vocation` FROM `players` WHERE `name` = " .. db.escapeString(name)) if(result:getID() == -1) then return false end local value = result:getDataString("vocation") result:free() return value end function onSay(cid, words, param, channel) if(param == '') then doPlayerPopupFYI(cid, "Bank management manual.\n\n" .. "!bank balance - show your account balance\n" .. "!bank deposit 100 - deposit 100 gold\n" .. "!bank withdraw 50 - withdraw 50 gold\n" .. "!bank transfer 30 God - transfer 30 gold to player God\n\n" .. "Tip: you can also use 'all' as amount.\n" .. "!bank deposit all - deposit all gold you have\n" .. "!bank withdraw all - withdraw all gold from your bank account" ) return true end local t = string.explode(param, " ", 2) local command = t[1]:lower() if(command == 'balance') then doPlayerSendCancel(cid, "Your account balance is " .. getPlayerBalance(cid) .. " gold.") elseif(command == 'deposit') then if(not t[2]) then doPlayerSendCancel(cid, "Amount is required.") return true end local amount = getAmount(t[2], cid, getPlayerMoney) if(validAmount(amount) and getPlayerMoney(cid) >= amount and doPlayerDepositMoney(cid, amount)) then doPlayerSendCancel(cid, amount .. " gold has been deposited.") else doPlayerSendCancel(cid, "Not enough money to deposit.") end elseif(command == 'withdraw') then if(not t[2]) then doPlayerSendCancel(cid, "Amount is required.") return true end local amount = getAmount(t[2], cid, getPlayerBalance) if(validAmount(amount) and getPlayerBalance(cid) >= amount and doPlayerWithdrawMoney(cid, amount)) then doPlayerSendCancel(cid, amount .. " gold has been withdrawn.") else doPlayerSendCancel(cid, "Not enough money to withdraw.") end elseif(command == 'transfer') then if(not t[2]) then doPlayerSendCancel(cid, "Amount is required.") return true end if(not t[3]) then doPlayerSendCancel(cid, "Player name to transfer is required.") return true end local amount, target = tonumber(t[2]), t[3] if(getPlayerGUID(cid) == getPlayerGUIDByName(target)) then doPlayerSendCancel(cid, "You cannot transfer money to yourself.") elseif(isInArray(config.transferDisabledVocations, getPlayerVocation(cid))) then doPlayerSendCancel(cid, "Your vocation cannot transfer money.") elseif(not validAmount(amount) or getPlayerBalance(cid) < amount) then doPlayerSendCancel(cid, "Not enough money to transfer.") else local targetVocation = getPlayerVocationByName(target) if(not playerExists(target) or not targetVocation or isInArray(config.transferDisabledVocations, targetVocation) or not doPlayerTransferMoneyTo(cid, target, amount)) then doPlayerSendCancel(cid, "This player does not exist on this world or have no vocation.") else doPlayerSendCancel(cid, "You have transferred " .. amount .. " gold to \"" .. target .."\".") end end else doPlayerSendCancel(cid, "Invalid command usage. Use '!bank' to view manual.") end return true end ]]></talkaction> </mod> !bank balance - mostra quanto de dinheiro você tem !bank deposit 100 - deposita 100 gold !bank withdraw 50 - retira 50 gold !bank transfer 30 God - transfere 30 gold para o player God !bank deposit all - deposita todo seu dinheiro !bank withdraw all - retira todo o seu dinheiro Créditos: slawkens OBS : ISSO É 1 MOD Clique na imagem e veja nosso TOPICO OFFICIAL
Postado Dezembro 10, 2012 12 anos Autor Eu já experimentei esse MOD , aqui não funciona: Por exemplo: eu estou com 1kk, eu digo !bank deposit 100 e aparece que eu não tenho dinheiro para depositar Editado Dezembro 10, 2012 12 anos por Disturbbed (veja o histórico de edições)
Postado Dezembro 10, 2012 12 anos <?xml version="1.0" encoding="UTF-8"?> <mod name="Bank System" version="1.0" author="Kimoszin" contact="tibiaking.com" enabled="yes"> <talkaction words="!balance; !deposit; !withdraw" event="buffer"><![CDATA[ if (words == "!balance") then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem "..getPlayerBalance(cid).." gold coins.") end if (words == "!deposit" and isNumber(param)) then return doPlayerDepositMoney(cid, param) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você depositou "..param.." gold coins.") end if (words == "!deposit" and param == "all") then return (getPlayerMoney(cid) > 0) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você depositou "..getPlayerMoney(cid).." gold coins.") and doPlayerDepositAllMoney(cid) end if (words == "!withdraw" and isNumber(param)) then return (getPlayerBalance(cid) > 0) and doPlayerWithdrawMoney(cid, tonumber(param)) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você retirou "..param.." gold coins.") end if (words == "!withdraw" and param == "all") then return (getPlayerBalance(cid) > 0) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você retirou "..getPlayerBalance(cid).." gold coins.") and doPlayerWithdrawAllMoney(cid) end ]]></talkaction> </mod>
Postado Dezembro 11, 2012 12 anos <?xml version="1.0" encoding="UTF-8"?> <mod name="Bank System" version="1.0" author="Kimoszin" contact="tibiaking.com" enabled="yes"> <talkaction words="!balance; !deposit; !withdraw" event="buffer"><![CDATA[ if (words == "!balance") then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem "..getPlayerBalance(cid).." gold coins.") end if (words == "!deposit" and isNumber(param)) then return doPlayerDepositMoney(cid, param) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você depositou "..param.." gold coins.") end if (words == "!deposit" and param == "all") then return (getPlayerMoney(cid) > 0) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você depositou "..getPlayerMoney(cid).." gold coins.") and doPlayerDepositAllMoney(cid) end if (words == "!withdraw" and isNumber(param)) then return (getPlayerBalance(cid) > 0) and doPlayerWithdrawMoney(cid, tonumber(param)) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você retirou "..param.." gold coins.") end if (words == "!withdraw" and param == "all") then return (getPlayerBalance(cid) > 0) and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você retirou "..getPlayerBalance(cid).." gold coins.") and doPlayerWithdrawAllMoney(cid) end ]]></talkaction> </mod> Kimoszin esse script ai funcionou deireitinho aqui no meu ot mas você poderia editar ele para ao invéz de depositar money depositace item que no caso seria 9971.. tem como fazer? vlw
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.