Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <mod name="Caixa Eletronico System" version="1.0" author="LuckOake" contact="none" enabled="yes">
- -----------------------------------------------------------------------
- <config name="caixa"><![CDATA[
- stor = 41319
- caixa_id = 1354 -- Id do Caixa Eletrônico
- bank_pos = {x = 78, y = 39, z = 7} -- Position da entrada do banco
- msgs = {
- [1] = "'balance' ou 'saldo' para ver seu saldo em conta.",
- [2] = "'deposit' ou 'depositar' para depositar dinheiro em sua conta.",
- [3] = "'withdraw' ou 'sacar' para sacar dinheiro de sua conta.",
- [4] = "'transfer' ou 'transferir' para transferir dinheiro para uma outra conta. Comando: transfer,quantia,nome",
- [5] = "'trocar gold' para trocar suas gold coins por platinum coins. Comando: trocar gold,número de platinum coins",
- [6] = "'trocar platinum' para trocar suas platinum coins por gold coins ou crystal coins. Comando: trocar platinum,gold ou crystal,número",
- [7] = "'trocar crystal' para trocar suas crystal coins por platinum coins. Comando: trocar crystal,número de platinum coins",
- [8] = "'sair' ou 'exit' para sair.",
- }
- ]]></config>
- -----------------------------------------------------------------------
- <action itemid="2556" event="script"><![CDATA[
- domodlib('caixa')
- if getPlayerStorageValue(cid, stor) ~= -1 then return true
- elseif itemEx.itemid ~= caixa_id then
- doPlayerSendCancel(cid, "Você só pode usar esse item em um caixa eletrônico.") return true
- end
- setPlayerStorageValue(cid, stor, 1)
- doPlayerSetNoMove(cid, true)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Caixa Eletrônico: Olá! Digite !caixa + um dos parâmetros abaixo:")
- for a, b in ipairs(msgs) do
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Caixa Eletrônico: "..b.."")
- end
- return true
- ]]></action>
- -----------------------------------------------------------------------
- <talkaction words="!caixa" event="buffer"><![CDATA[
- domodlib('caixa')
- t = string.explode(param, ",")
- if getPlayerStorageValue(cid, stor) ~= 1 then return true end
- if t[1] == "balance" or t[1] == "saldo" then
- if t[2] then return true end
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Caixa Eletrônico: Você possui "..getPlayerBalance(cid).." gold coins em sua conta bancária.")
- elseif t[1] == "deposit" or t[1] == "depositar" then
- if not t[2] or not tonumber(t[2]) or t[3] then
- doPlayerSendCancel(cid, "Incorrect params.") return true
- elseif not doPlayerDepositMoney(cid, tonumber(t[2])) then
- doPlayerSendCancel(cid, "Você não possui essa quantia em dinheiro.") return true
- end
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Caixa Eletrônico: Você depositou "..t[2].." gold coins em sua conta. Seu saldo agora é de "..getPlayerBalance(cid).." gold coins.")
- elseif t[1] == "withdraw" or t[1] == "sacar" then
- if not t[2] or not tonumber(t[2]) or t[3] then
- doPlayerSendCancel(cid, "Incorrect params.") return true
- elseif getPlayerBalance(cid) < tonumber(t[2]) then
- doPlayerSendCancel(cid, "Você não possui essa quantia de dinheiro em sua conta.") return true
- end
- doPlayerWithdrawMoney(cid, tonumber(t[2]))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Caixa Eletrônico: Você sacou "..t[2].." gold coins de sua conta. Seu saldo agora é de "..getPlayerBalance(cid).." gold coins.")
- elseif t[1] == "transfer" or t[1] == "transferir" then
- if not t[2] or not tonumber(t[2]) or not t[3] or not tostring(t[3]) or t[4] then
- doPlayerSendCancel(cid, "Incorrect params.") return true
- elseif getPlayerBalance(cid) < tonumber(t[2]) then
- doPlayerSendCancel(cid, "Você não possui essa quantia de dinheiro em sua conta.") return true
- elseif not playerExists(t[3]) then
- doPlayerSendCancel(cid, "O player "..t[3].." não existe.") return true
- end
- doPlayerTransferMoneyTo(cid, t[3], tonumber(t[2]))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Caixa Eletrônico: Você transferiu "..t[2].." gold coins de sua conta para "..t[3]..". Seu saldo agora é de "..getPlayerBalance(cid).." gold coins.")
- elseif t[1] == "trocar gold" then
- if not t[2] or not tonumber(t[2]) or t[3] then
- doPlayerSendCancel(cid, "Incorrect params. Specify the number of platinum coins you want to get.") return true
- elseif not doPlayerRemoveItem(cid, 2148, (t[2]*100)) then
- doPlayerSendCancel(cid, "Você não possui "..(t[2]*100).." gold coins.") return true
- end
- doPlayerAddItem(cid, 2152, t[2])
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Caixa Eletrônico: Você trocou "..(t[2]*100).." gold coins por "..t[2].." platinum coins.")
- elseif t[1] == "trocar platinum" then
- if t[2] == "gold" then
- if not t[3] or not tonumber(t[3]) or t[4] then
- doPlayerSendCancel(cid, "Incorrect params. Specify the number of platinum coins you want to change to gold coins.") return true
- elseif not doPlayerRemoveItem(cid, 2152, tonumber(t[3])) then
- doPlayerSendCancel(cid, "Você não possui "..t[3].." platinum coins.") return true
- end
- doPlayerAddItem(cid, 2148, tonumber(t[3]*100))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Caixa Eletrônico: Você trocou "..t[3].." platinum coins por "..(t[3]*100).." gold coins.")
- elseif t[2] == "crystal" then
- if not t[3] or not tonumber(t[3]) or t[4] then
- doPlayerSendCancel(cid, "Incorrect params. Specify the number of crystal coins you want to get.") return true
- elseif not doPlayerRemoveItem(cid, 2152, tonumber(t[3]*100)) then
- doPlayerSendCancel(cid, "Você não possui "..(t[3]*100).." platinum coins.") return true
- end
- doPlayerAddItem(cid, 2160, tonumber(t[3]))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Caixa Eletrônico: Você trocou "..(t[3]*100).." platinum coins por "..t[3].." crystal coins.")
- else
- return doPlayerSendCancel(cid, "Incorrect params. Utilize o comando assim: trocar platinum,gold ou crystal,quantia")
- end
- elseif t[1] == "trocar crystal" then
- if not t[2] or not tonumber(t[2]) or t[3] then
- doPlayerSendCancel(cid, "Incorrect params. Specify the number of crystal coins you want to change to platinum coins.") return true
- elseif not doPlayerRemoveItem(cid, 2160, tonumber(t[2])) then
- doPlayerSendCancel(cid, "Você não possui "..t[2].." crystal coins.") return true
- end
- doPlayerAddItem(cid, 2152, tonumber(t[2]*100))
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Caixa Eletrônico: Você trocou "..t[2].." crystal coins por "..(t[2]*100).." platinum coins.")
- elseif t[1] == "sair" or t[1] == "exit" then
- doTeleportThing(cid, bank_pos)
- setPlayerStorageValue(cid, stor, -1)
- doPlayerSetNoMove(cid, false)
- doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Caixa Eletrônico: Obrigado pela visita!")
- else return doPlayerSendCancel(cid, "Incorrect Params.") end
- return true
- ]]></talkaction>
- </mod>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement