• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

banksystem

Daxu

Banned User
Joined
Jun 18, 2010
Messages
336
Reaction score
9
Location
Poland
Hey
i need rl tibia Rokyn (Venore) and rl bank system :D
preferably form Cykotitan XDD
 
With this bank system you can do:


!bank [command] [amount]
Withdraw
!bank withdraw 1000
!bank w 1000
!withdraw 1000
Balance
!bank balance
!bank b
!balance
Deposit
!bank deposit 100
!bank d 100
!deposit 100
---
Or else:
!bank [cmd] all
!bank deposit all
!bank withdraw all



Talkactions.xml add:


XML:
<talkaction words="!bank" event="script" value="bank.lua" />
<talkaction words="!withdraw" event="script" value="bank.lua" />
<talkaction words="!deposit" event="script" value="bank.lua" />
<talkaction words="!balance" event="script" value="bank.lua" />


data/talkactions/scripts/bank.lua



LUA:
---Script by mock the bear
local storeige = 18316
local function msg(cid,m)
	doCreatureSay(cid,m,TALKTYPE_ORANGE_1)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, m)
end
function onSay(cid, words, param, channel) ---Script by mock the bear
	local c = getPlayerStorageValue(cid,storeige)
	c = c == -1 and 0 or c
	if param:find('balance') or param == 'b' or (words == '!balance') then
		msg(cid,'Account balance '..c..'')
	elseif param:find('amount') or param == 'a' then
		local c = getPlayerMoney(cid)
		doCreatureSay(cid,'Account balance '..c..' gps.',TALKTYPE_ORANGE_1)
		msg(cid,'Your account balance contains only '..c..' gps.')
	elseif param:match('deposit (.+)') or param:match('d (.+)') or (words == '!deposit') then
		local v = param:match('deposit (.+)') or param:match('d (.+)') or tonumber(param) or param == 'all' and param
		local dep = tonumber(v == 'all' and getPlayerMoney(cid) or v)
		if not dep then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Insert a value')
		else
			if getPlayerMoney(cid) >= dep then
				setPlayerStorageValue(cid,storeige,c+dep)
				doPlayerRemoveMoney(cid,dep)
				msg(cid,'Deposit '..dep..'.')
			else
				msg(cid,'Your account balance contains only '..getPlayerMoney(cid)..'.')
			end
		end
	elseif param:match('withdraw (.+)') or param:match('w (.+)') or (words == '!withdraw') then
		local v = param:match('withdraw (.+)') or param:match('w (.+)') or tonumber(param) or param == 'all' and param
		local dep = tonumber(v == 'all' and c or v)
		if not dep then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Insert a value')
		else
			if c >= dep then
				setPlayerStorageValue(cid,storeige,c-dep)
				doPlayerAddMoney(cid,dep)
				msg(cid,'Withdraw '..dep..'.')
			else
				msg(cid,'Your account balance contains only '..c..'.')
			end
		end
	else
		doPlayerSendTextMessage(cid, 25, "Use like this:\n!bank deposit x\n!bank balance\n!bank withdraw\n!bank amount(ou assim)\n!bank d x\n!bank w x\n!bank deposit all\n!bank a")
	end
	return TRUE
end



Script by Mock The Bear
bearpaw.png
 
Back
Top