Bank System 8.60

Godvinih
em Tutoriais de Scripting

Godvinih

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/01/12Posts: 11Char no Tibia: Sou mapper e scripter

Olá pessoal meu nome é vinicius e vou postar o Bank System 8.60

Nesses Script's não precisa edita nada a não ser que você queira deichar em português.

Da REP+ ae.custa nada =)

Primeiramente vá na pasta takactionse crie outra pasta chamada Bank ok. ange.gif

dentro da pasta Bank faça arquivos (.lua) chamados...

balance

deposit

deposit_all

transfer

transfer_all

withdraw

withdraw_all

E dentro desses arquivos coloque isso.

 

(balance.lua)

 function onSay(cid, words, param)

local config = {
	bankSystemEnabled = getBooleanFromString(getConfigInfo('bankSystem')),
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT)
}

if config.bankSystemEnabled == TRUE then
	if config.playerIsFighting == FALSE then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your account balance is " .. getPlayerBalance(cid) .. ".")
	return TRUE
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bank can not be used in fight.")
	return TRUE
end
else
	return FALSE
	end
end

 

 

(deposit.lua)

 function onSay(cid, words, param)
local config = {
	bankSystemEnabled = getBooleanFromString(getConfigInfo('bankSystem')),
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT)
}
if config.bankSystemEnabled == TRUE then
	if config.playerIsFighting == FALSE then
if(param == "") then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires param.")
	return TRUE
end
local m = tonumber(param)
if(not m) then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires numeric param.")
	return TRUE
end
m = math.abs(m)
if m <= getPlayerMoney(cid) then
	doPlayerDepositMoney(cid, m)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Alright, you have added the amount of " .. m .. " gold to your balance. You can withdraw your money anytime you want to. Your account balance is " .. getPlayerBalance(cid) .. ".")
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You do not have enough money.")
	end
	return TRUE
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bank can not be used in fight.")
	return TRUE
end
else
	return FALSE
	end
end

(deposit_all.lua)

 function onSay(cid, words, param)
local config = {
	bankSystemEnabled = getBooleanFromString(getConfigInfo('bankSystem')),
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT)
}
if config.bankSystemEnabled == TRUE then
	if config.playerIsFighting == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Alright, you have added the amount of " .. getPlayerMoney(cid) .. " gold to your balance. You can withdraw your money anytime you want to.")
doPlayerDepositAllMoney(cid)
return TRUE
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bank can not be used in fight.")
	return TRUE
end
else
	return FALSE
	end
end

(transfer.lua)

 function onSay(cid, words, param)
local config = {
	bankSystemEnabled = getBooleanFromString(getConfigInfo('bankSystem')),
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT)
}
if config.bankSystemEnabled == TRUE then
	if config.playerIsFighting == TRUE then
if(param == "") then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires param.")
	return TRUE
end
local t = string.explode(param, ",")
local m = tonumber(t[2])
local tmp = string.explode(t[2], ",")
if(not m) then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "No money specified.")
	return TRUE
end
m = math.abs(m)
if m <= getPlayerBalance(cid) then
	if playerExists(t[1]) then
	doPlayerTransferMoneyTo(cid, t[1], m)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have transferred " .. m .. " gold to " .. t[1] .. ". Your account balance is " .. getPlayerBalance(cid) .. " gold.")
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Player " .. t[1] .. " does not exist.")
	end
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "There is not enough gold on your account. Your account balance is " .. getPlayerBalance(cid) .. ". Please tell the amount of gold coins you would like to transfer.")
	end
	return TRUE
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bank can not be used in fight.")
	return TRUE
end
else
	return FALSE
	end
end

(transfer_all)

 function onSay(cid, words, param)
local config = {
	bankSystemEnabled = getBooleanFromString(getConfigInfo('bankSystem')),
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT)
}
if config.bankSystemEnabled == TRUE then
if(param == "") then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires param.")
	return TRUE
end
local t = string.explode(param, ",")
if playerExists(param) then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have transferred " .. getPlayerBalance(cid) .. " gold to " .. param .. ".")
	doPlayerTransferAllMoneyTo(cid, param)
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Player " .. param .. " does not exist.")
	return TRUE
end
else
	return FALSE
	end
end

(withdraw.lua)

 function onSay(cid, words, param)
local config = {
	bankSystemEnabled = getBooleanFromString(getConfigInfo('bankSystem')),
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT)
}
if config.bankSystemEnabled == TRUE then
	if config.playerIsFighting == FALSE then
local m = tonumber(param)
if(param == "") then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires param.")
	return TRUE
end
if(not m) then
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Command requires numeric param.")
	return TRUE
end
m = math.abs(m)
if m <= getPlayerBalance(cid) then
	doPlayerWithdrawMoney(cid, m)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Here you are, " .. m .. " gold. Your account balance is " .. getPlayerBalance(cid) .. ".")
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "There is not enough gold on your account.")
	end
	return TRUE
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bank can not be used in fight.")
	return TRUE
end
else
	return FALSE
	end
end

(withdraw_all.lua)

 function onSay(cid, words, param)
local config = {
	bankSystemEnabled = getBooleanFromString(getConfigInfo('bankSystem')),
	playerIsFighting = hasCondition(cid, CONDITION_INFIGHT)
}
if config.bankSystemEnabled == TRUE then
	if config.playerIsFighting == FALSE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Here you are, " .. getPlayerBalance(cid) .. " gold.")
doPlayerWithdrawAllMoney(cid)
return TRUE
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Bank can not be used in fight.")
	return TRUE
end
else
	return FALSE
	end
end

Agora vá em talkactions.lua e coloque isso...deixando separado dos outros.

<!-- Bank -->
<talkaction log="yes" words="!balance" script="bank\balance.lua">
<talkaction log="yes" words="!deposit" script="bank\deposit.lua">
<talkaction log="yes" words="!withdraw" script="bank\withdraw.lua">
<talkaction log="yes" words="!transfer" script="bank\transfer.lua">
<talkaction log="yes" words="!depositall" script="bank\deposit_all.lua">
<talkaction log="yes" words="!withdrawall" script="bank\withdraw_all.lua">
<talkaction log="yes" words="!transferall" script="bank\transfer_all.lua">

Terminou :D

Comandos,e para que servem.

!balance ,Para você ver quanto você tem na sua conta bancaria.
!deposit ,Para você depositar certa quantia Ex:!deposit 100.
!withdraw ,Para você Retirar certa quantia Ex:!withdraw 100.
!transfer ,Para você transferir certa quantia para outro player.
!depositall ,Para você depositar tudo o que tem na Backpack.
!withdrawall ,Para você retirar tudo o que tem na sua conta.
!transferall ,Para você transferir tudo o que tem para outro player.

Vlw ae Galera da REP+ ae.positivo.gif

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

Parece ótimo, mais eu não usaria por ser talkaction, eu prefiro em NPC mesmo, até

Fabio Augustus - Infraestrutura

Skype: guhsvasc

Godvinih

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/01/12Posts: 11Char no Tibia: Sou mapper e scripter

Mais ficou bom o tutorial??É o meu 1º tuto...e estou fazendo um ot e quando terminar vou postar magias que vou fazer,Npcs e comandos e monsters :D

 

aaah e pelo bank system dependendo o ot pode ser nukado --' dizem por aii nunca vi isso

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

Hum... interessante, rep+ para Você como isentivo.

Fabio Augustus - Infraestrutura

Skype: guhsvasc

Godvinih

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/01/12Posts: 11Char no Tibia: Sou mapper e scripter

vlw ae :D

Piabeta Kun

Ex-Coordenador de Websites
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 23/12/08Posts: 2403Gênero: MasculinoChar no Tibia: Gordo Warlike

Parece ótimo, mais eu não usaria por ser talkaction, eu prefiro em NPC mesmo, até

 

existe muitos bugs com relacao aos npcs de banco, talkatcion perde o rpg, mais torna mais seguro contra bugs!

Daijobu!

 

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

uso em npc e nunca tive problemas, até

Fabio Augustus - Infraestrutura

Skype: guhsvasc

Piabeta Kun

Ex-Coordenador de Websites
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 23/12/08Posts: 2403Gênero: MasculinoChar no Tibia: Gordo Warlike

mano pq se deu sorte ou de nao conter bug ou de niguem saber usar o bug no seu npc! ja sofri com isso e sei como é brabo esse bug!

Daijobu!

 

Beeki

Ex-Coordenador XDev
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 12/03/11Posts: 1900Gênero: MasculinoChar no Tibia: Nokte

o Tutorial em si está ótimo, reportando para a Moderação mover para a sessão de Tutoriais.

Fabio Augustus - Infraestrutura

Skype: guhsvasc

Gabriel Couto

Anyur
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 22/04/11Posts: 2455Gênero: MasculinoChar no Tibia: Thyn Zare

Aprovado, Parabéns, Continue Assim!

Mostrou um bom conteúdo, que, com certeza, deverá ajudar muita gente.

 

Movido para a Seção Correta!

Gabriel Couto, 23 anos. Acadêmico de Medicina.

Ex-Diretor Geral do XTibia.

 

www.tibiatv.com.br

 

 

Godvinih

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/01/12Posts: 11Char no Tibia: Sou mapper e scripter

a vão toma no cú tibia é o jogo mais facil de fazer scripter é só você estuda um pOKO sobre computaçao e ficar tentando que não é dificil, e se tiver bug muda o script pois eu que sou uma bosta passei um script 8.0 pra 8.60 na digitaçao akela magia expeliarmus e tava bugado,se tem bug arruma e agora vou postar a magia Exori Gran Flux (para paladinos que só existem em ot's Pbot's pois é legal e todos os paladinos de todos os ots server (a maioria sao um lixo),desvalriza) ...

 

valeu ae moderador, esse foi meu 1º script que eu postei aqui =)