Tazio - New Banking reskin

I will get on it

1 Like

The error above @Tazio, I have fixed. Here is the server.lua for that so they can transfer money from accounts again, It’s not my work it’s from the original post and i just thought i’d try that server.lua in your re-skin version and it works. So here is that file.

--================================================================================================
--==                                VARIABLES - DO NOT EDIT                                     ==
--================================================================================================
ESX = nil

TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)

RegisterServerEvent('bank:deposit')
AddEventHandler('bank:deposit', function(amount)
	local _source = source
	
	local xPlayer = ESX.GetPlayerFromId(_source)
	if amount == nil or amount <= 0 or amount > xPlayer.getMoney() then
		-- advanced notification with bank icon
		TriggerClientEvent('esx:showAdvancedNotification', _source, 'Bank', 'Deposit Money', 'Invalid amount', 'CHAR_BANK_MAZE', 9)
	else
		xPlayer.removeMoney(amount)
		xPlayer.addAccountMoney('bank', tonumber(amount))
                -- advanced notification with bank icon
		TriggerClientEvent('esx:showAdvancedNotification', _source, 'Bank', 'Deposit Money', 'Deposited ~g~$' .. amount .. '~s~', 'CHAR_BANK_MAZE', 9)
	end
end)


RegisterServerEvent('bank:withdraw')
AddEventHandler('bank:withdraw', function(amount)
	local _source = source
	local xPlayer = ESX.GetPlayerFromId(_source)
	local base = 0
	amount = tonumber(amount)
	base = xPlayer.getAccount('bank').money
	if amount == nil or amount <= 0 or amount > base then
                 -- advanced notification with bank icon
		TriggerClientEvent('esx:showAdvancedNotification', _source, 'Bank', 'Withdraw Money', 'Invalid amount', 'CHAR_BANK_MAZE', 9)
	else
		xPlayer.removeAccountMoney('bank', amount)
		xPlayer.addMoney(amount)
                 -- advanced notification with bank icon
                TriggerClientEvent('esx:showAdvancedNotification', _source, 'Bank', 'Withdraw Money', 'Withdrawed ~r~$' .. amount .. '~s~', 'CHAR_BANK_MAZE', 9)
	end
end)

RegisterServerEvent('bank:balance')
AddEventHandler('bank:balance', function()
	local _source = source
	local xPlayer = ESX.GetPlayerFromId(_source)
	balance = xPlayer.getAccount('bank').money
	TriggerClientEvent('currentbalance1', _source, balance)
	
end)


RegisterServerEvent('bank:transfer')
AddEventHandler('bank:transfer', function(to, amountt)
	local _source = source
	local sourceXPlayer = ESX.GetPlayerFromId(_source)
	local targetXPlayer = ESX.GetPlayerFromId(tonumber(to))
	local balance = sourceXPlayer.getAccount('bank').money
	
	if _source == tonumber(to) then
                -- advanced notification with bank icon
		TriggerClientEvent('esx:showAdvancedNotification', _source, 'Bank', 'Transfer Money', 'We will transfer you to you!', 'CHAR_BANK_MAZE', 9)
	else
		if balance < 1 or balance < tonumber(amountt) or tonumber(amountt) < 1 then
                        -- advanced notification with bank icon
			TriggerClientEvent('esx:showAdvancedNotification', _source, 'Bank', 'Transfer Money', 'You do not have enough to transfer!', 'CHAR_BANK_MAZE', 9)
		else
			sourceXPlayer.removeAccountMoney('bank', tonumber(amountt))
			targetXPlayer.addAccountMoney('bank', tonumber(amountt))
                        -- advanced notification with bank icon
				TriggerClientEvent('esx:showAdvancedNotification', _source, 'Bank', 'Transfer Money', 'You have transferred ~r~$' .. amountt .. '~s~ to ~r~' .. to .. ' .', 'CHAR_BANK_MAZE', 9)
				TriggerClientEvent('esx:showAdvancedNotification', to, 'Bank', 'Transfer Money', 'You have received ~r~$' .. amountt .. '~s~ from ~r~' .. _source .. ' .', 'CHAR_BANK_MAZE', 9)
		end
	end
end)

Just make this as a server.lua and it replace the one in this script, It does use the same functions as before such as the player ID needed to transfer to

1 Like

Trying this now as well ;o

edit:
It works with the Player ID, just not the names/If someone types in a wrong ID on accident you lose your money. But none the less, we’re getting somewhere.


https://gyazo.com/446711fa6bf3021373a89356c66c72c4

Cool, I will update asap. Thanks

refer to my post before, players may lose money.

Yeah i just noticed that, Will do some digging and try and get it fixed.

Have you ented a person where ya wanna transfer it to?

Try the newest version https://github.com/Tazi0/new_banking

do i need to install the original new_banking ? because when i press e in front of an atm, my cursor appear but not the menu

1 Like

try again… to install

Error running system event handling function for resource new_banking: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: @new_banking/server.lua:85: attempt to concatenate a nil value (upvalue 'NewestVersion')
stack traceback:
        @new_banking/server.lua:85: in local 'userCallback'
        citizen:/scripting/lua/scheduler.lua:318: in upvalue 'handler'
        citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218>
stack traceback:
        [C]: in function 'error'
        citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow'
        citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182>

are you sure you installed the latest?

yes from the github

What is the latest commit/push?

image
but wtf
image

can you send me the latest version?

yes download that one

you updated the github an hour ago but there is a mark that it was updated three months ago

i know i deleted the last 2 pushes

the script isn’t working for me


i press e, the cursor apear but nothing

I Have the same error