Ir para conteúdo

Bank System [8.60] comando !saldo, !sacar, !depositar ( até no max 100 ) com id de x item

Featured Replies

Postado

Boa noite, gostaria de um sistema simples para tibia 8.60, o sistema é o seguinte, você tem x item na backpack e ao usar os comandos exemplo; !sacar 30 pegaria as moedas de sua conta, caso tenha no saldo. !saldo para verificar quantas possui na conta ( não somente no personagem ) e !depositar 1 para depositar a moeda em sua conta. Espero que consegui explicar bem o sistema, obrigado desde já.

( OBS: a quantia máxima de saque e deposito seria 100! )

Caso eu coloquei o tópico em local errado peço perdão e que mova ao local adequado.

Editado por Strikerzerh (veja o histórico de edições)

  • 1 month later...
  • Respostas 12
  • Visualizações 1.3k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • você n tem essa função na sua lib ou no script bota acima ela   function getTimeString(self) local format = { {'dia', self / 60 / 60 / 24}, {'hora', self / 60 / 60 % 24},

Postado

cara eu tenho um sistema parecido, vc só precisaria adaptar ele um pouco.

local config = {
	s = 10546, -- n mexa
	exhau = 2 -- tempo em seegundos 
}

function onSay(cid, words, param)

	local id_mining = 2328
	local msg = string.lower(param)
	local storage_minings = 5435300
	local retirado = 0
	local save_mining = 0
	local s = string.explode(param, " ")
	
	if (getPlayerStorageValue(cid, config.s) <= os.time()) then
		doPlayerSave(cid)
		if isInArray({"balance", "saldo"}, msg) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você possui ".. tonumber(getPlayerStorageValue(cid, storage_minings)) .." Mining Coins salvo em Storage!")
			setPlayerStorageValue(cid, config.s, os.time()+config.exhau)
		elseif isInArray({"deposit", "depositar"}, msg) then
			local minings = getPlayerItemCount(cid, id_mining)
			if minings > 0 then
				doPlayerRemoveItem(cid, id_mining, minings)
				setPlayerStorageValue(cid, storage_minings, tonumber(getPlayerStorageValue(cid, storage_minings)+minings))
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você Depositou ".. minings .." Mining Coins! Seu saldo é de: "..tonumber(getPlayerStorageValue(cid, storage_minings)))
			else
				doPlayerSendCancel(cid, "Você não tem mining Coins!")
				return true
			end
			setPlayerStorageValue(cid, config.s, os.time()+config.exhau)
		elseif isInArray({"sacar", "withdraw"}, s[1]) then
			if s[2] and tonumber(s[2]) then
				local m = tonumber(s[2])
				if tonumber(getPlayerStorageValue(cid, storage_minings)) < m then
					doPlayerSendTextMessage(cid, 22, "Você não possui ".. m .." mining coins!")
				else
					for i=1, (m/3500)+1 do
						bp = doCreateItemEx(2002, 1)
						if m >= 3500 then 
							doAddContainerItem(bp, id_mining, 3500)
							retirado = 3500
						else
							doAddContainerItem(bp, id_mining, m)
							retirado = m
						end
						receive = doPlayerAddItemEx(cid, bp)
						if receive ~= RETURNVALUE_NOERROR then
							doPlayerSendTextMessage(cid, 22, "Não foi possivel Entregar Tudo, tenha espaço em sua BP!")	
						else
							setPlayerStorageValue(cid, storage_minings, tonumber(getPlayerStorageValue(cid, storage_minings)-retirado))
							m = m -  retirado
							save_mining = save_mining + retirado
						end
					end
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você sacou ".. save_mining .." Mining Coins! Seu saldo é de: "..tonumber(getPlayerStorageValue(cid, storage_minings)))
				end
			else
				doPlayerSendTextMessage(cid, 22, "Insira uma quantidade valida!")
			end
		end
		setPlayerStorageValue(cid, config.s, os.time()+600)
	else
		doPlayerSendCancel(cid, "Voce tem que esperar " .. getTimeString(getPlayerStorageValue(cid, config.s)-os.time()).."!")
	end
	
   return true
end

 

  • 2 months later...
Postado
Em 03/09/2022 em 07:57, FeeTads disse:

cara eu tenho um sistema parecido, vc só precisaria adaptar ele um pouco.


local config = {
	s = 10546, -- n mexa
	exhau = 2 -- tempo em seegundos 
}

function onSay(cid, words, param)

	local id_mining = 2328
	local msg = string.lower(param)
	local storage_minings = 5435300
	local retirado = 0
	local save_mining = 0
	local s = string.explode(param, " ")
	
	if (getPlayerStorageValue(cid, config.s) <= os.time()) then
		doPlayerSave(cid)
		if isInArray({"balance", "saldo"}, msg) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você possui ".. tonumber(getPlayerStorageValue(cid, storage_minings)) .." Mining Coins salvo em Storage!")
			setPlayerStorageValue(cid, config.s, os.time()+config.exhau)
		elseif isInArray({"deposit", "depositar"}, msg) then
			local minings = getPlayerItemCount(cid, id_mining)
			if minings > 0 then
				doPlayerRemoveItem(cid, id_mining, minings)
				setPlayerStorageValue(cid, storage_minings, tonumber(getPlayerStorageValue(cid, storage_minings)+minings))
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você Depositou ".. minings .." Mining Coins! Seu saldo é de: "..tonumber(getPlayerStorageValue(cid, storage_minings)))
			else
				doPlayerSendCancel(cid, "Você não tem mining Coins!")
				return true
			end
			setPlayerStorageValue(cid, config.s, os.time()+config.exhau)
		elseif isInArray({"sacar", "withdraw"}, s[1]) then
			if s[2] and tonumber(s[2]) then
				local m = tonumber(s[2])
				if tonumber(getPlayerStorageValue(cid, storage_minings)) < m then
					doPlayerSendTextMessage(cid, 22, "Você não possui ".. m .." mining coins!")
				else
					for i=1, (m/3500)+1 do
						bp = doCreateItemEx(2002, 1)
						if m >= 3500 then 
							doAddContainerItem(bp, id_mining, 3500)
							retirado = 3500
						else
							doAddContainerItem(bp, id_mining, m)
							retirado = m
						end
						receive = doPlayerAddItemEx(cid, bp)
						if receive ~= RETURNVALUE_NOERROR then
							doPlayerSendTextMessage(cid, 22, "Não foi possivel Entregar Tudo, tenha espaço em sua BP!")	
						else
							setPlayerStorageValue(cid, storage_minings, tonumber(getPlayerStorageValue(cid, storage_minings)-retirado))
							m = m -  retirado
							save_mining = save_mining + retirado
						end
					end
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você sacou ".. save_mining .." Mining Coins! Seu saldo é de: "..tonumber(getPlayerStorageValue(cid, storage_minings)))
				end
			else
				doPlayerSendTextMessage(cid, 22, "Insira uma quantidade valida!")
			end
		end
		setPlayerStorageValue(cid, config.s, os.time()+600)
	else
		doPlayerSendCancel(cid, "Voce tem que esperar " .. getTimeString(getPlayerStorageValue(cid, config.s)-os.time()).."!")
	end
	
   return true
end

 

nao entendi esse script, onde adiciono ?

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo