17.09.2008, 00:23
pBank [Extensive Banking System]
Details:- Unlike most other bank scripts which are in filterscripts and can't really be controlled by the scripter, pBank is inside an include and can be very extensive when used properly. It contains the basic bank functions, then there are special ones such as the loan system. This system is in it's beta mode is more and more features should pop up soon.
- pBank_CreateBankAccount(Owner[],Balance,AccountPass[])
Allows you to create a bank account with a starting balance and an account password. The owner can be a gang group, an individual, or a security force. Whatever comes to mind! See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_GetBankBalance(Owner[])
Lets you get the bank balance of the specified owner. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_SetBankBalance(Owner[],Amount)
Lets you set the bank balance of the specified owner. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_LoginPlayerToBank(Owner[],AccountPass[])
Can/Should be used inside a login command. Logins the player to his account. If AccountPass[] does not match with the one that is inside the bank file, then the player can't login. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_DepositMoney(Owner[],Amount)
The basic deposit function. Let's you deposit money from your pocket to the bank account. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_WithdrawMoney(Owner[],Amount)
The basic withdraw function. Let's you withdraw money from your bank account. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_DeleteBankAccount(Owner[])
Allows you to delete your bank account. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_PlayerGetLoan(Player[],Amount)
Allows you to get a loan from the bank of any amount. That loan is placed in your bank file which you can pay off whenever you want. There is no security on this function on how much you can take from the bank or when you have to pay. That is up to the scripter to decide. I decided to leave the security out so that the scripter can expand his system without the security's limitation. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_PlayerPaymentOnLoan(Player[],PartialPayment)
Let's you pay any amount to the loan you have on your account. If you owe the bank $100, and you pay $150, the $50 left over is then deposited to your account. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_WireTransfer(Sender[],Receiver[],Amount)
Let's you transfer funds from your account to somebody elses. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_PlayerDisconnect(Player[])
This function must be used! Place it at the OnPlayerDisconnect callback. If not used, the player won't be logged out, his pocket money won't be saved, and the next person with his same id, will be able to use his account! See Example.pwn inside RAR for an example on how it works and how it is used.
-
Credits to DracoBlue for his dini! I plan on using djSon in the next versions, but only when I get the hang of it.
-
To modify or redistribute you need my permission.
- If you have a suggestion, please post it. I would love to add more features into this script. Also report any bugs you find. Have trouble? I will be more than happy to help you resolve it, just don't PM me the question!
See below for 0.2 download.
__________________________________________________ ________________________________________
0.2 Update [pBank]
0.2 Update:- Update 0.2 contains a new feature and due to this new feature, is not backwards compatible with pBank 0.1. The new added feature are adjustable interest rates for each account and an adjustable interest interval(default=1hr).
- pBank_GameModeInit()
Without using this function in your OnGameModeInit callback, the interest feature will not work! See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_SetInterestRate(Owner[],Percent)
Allows you to set the interest rate for a person's bank account. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_RemoveInterest(Owner[])
Removes a set interest rate from a person's bank account. See Example.pwn inside RAR for an example on how it works and how it is used.
- pBank_SetInterestInterval(time)
Sets the interval when each interest is deposited into the applicable accounts. Setting to 0 will disable, default is 1 hour. See Example.pwn inside RAR for an example on how it works and how it is used.