ARCBank Documentation

I haven't finished my new website yet, so for now you get a 1990's style looking thing.

nil ARCBank_OnTransaction(transaction_type, account1, account2, user1, user2, moneydiff, money, comment) (Server)

This hook is called whenever any transaction is successfully completed on the server. Use hook.Add("ARCBank_OnTransaction","Name",func)

Click the argument list above for more information about them

Code examples

-- Congratulates the user when they create an ARCBank account (server)
hook.Add("ARCBank_OnTransaction","Congratulate", function(transaction_type,account1,account2,user1,user2,moneydiff,money,comment)
	if transaction_type == ARCBANK_TRANSACTION_CREATE then
		local ply = ARCBank.GetPlayerByID(user1)
		if IsValid(ply) then
			ply:ChatPrint( "Congratulations on your new ARCBank account!" )
		end
	end
end)


-- Tells the player what their balance is when it has been changed
hook.Add("ARCBank_OnTransaction","Congratulate", function(transaction_type,account1,account2,user1,user2,moneydiff,money,comment)
	if money != nil and string.StartWith( account1, "_" ) then -- Money is nil if the balance has not changed, and personal account IDs start with "_"
		local ply = ARCBank.GetPlayerByID(user1)
		if IsValid(ply) then
			ply:ChatPrint( "Your ARCBank balance is currently "..money )
		end
	end
end)