Charas-Project
Game Creation => Requests => RPG Maker Programming => Topic started by: neb87 on February 20, 2006, 07:03:21 AM
-
This is what i have for a bank system!
Message-What do you want to do?
Choice-1.Deposit 2.Withdraw 3.Leave
1.Deposit
Variable Oper:[current money] Set Money
Message-How much would you like to deposit?
Input Number-5 digit[enterted money]
Branch if [enterted money] is V[current money] Greater
Variable Oper:[enterted money] Set, Var [current money]'s value
End
Variable Oper:[bank money]+, Var [enterted money]'s value
Change Money: V[enterted money]add
2.Withdraw
Message-How much would you like to Withdraw?
Input Number-5 digit[enterted money]
Branch if [enterted money] is V[bank money] Greater
Variable Oper:[enterted money] Set, Var [bank money]'s value
End
Change Money: V[enterted money]add
Variable Oper:[bank money]-, Var [entered money]'s value
I got most of this from gaming world but it doesn't work when i use it, does anybodie see the problem or know how to make a working bank system?
-
The only way I know is they way I used it from the PS1 version which'd take about 250 switches XD
-
i got a differnt tut but am having problems with the withdrawls now!!
--------So if anybodie has a working bank system, help me out!!
Basicalliy the problem is that i can put money in the bank with only how much i have and i can withdraw however much i have in bank but i can withdraw it again again(doesn't take money out of bank.
-EXE_I Deposit 1 buck, so i have 0 bucks on me and then i withdraw 1 buck so i have 1 buck on me but i can withdraw 1 buck again and again!
-
Try this:
<>Show Choices: Deposit/Withdraw/Leave
: [Deposit] Handler
: <>Message: How much would you like to deposit?
: <>Input number: 6 Digit, [0001: Bank Transaction]
: <>Variable Oper: [0003: Current Money] Set, Money
: <>Branch if Var [0001: Bank Transaction] is V[0003] Less/Equal
: : <>Change Money: V[0001] Remove
: : <>Variable Oper: [0002: Banked Money] +, Var [0001]'s Value
: : <>Message: Your transaction is complete!
: : :Have a nice day!
: : <>
: : Else Handler:
: : <>Message: You don't have that much!
: : End
: <>
: [Withdraw] Handler
: <>Message: How much would you like to withdraw?
: <>Input number: 6 Digit, [0001: Bank Transaction]
: <>Branch if Var [0001: Bank Transaction] is V[0002] Less/Equal
: : <>Change Money: V[0001] Add
: : <>Variable Oper: [0002: Banked Money] -, Var [0001]'s Value
: : <>Message: Your transaction is complete!
: : :Have a nice day!
: : <>
: : Else Handler:
: : <>Message: You don't have that much!
: : End
: <>
: [Leave] Handler
: <>
: End
<>
-
Now it doesn't repeatit again and again but if i deposieted 400 in bank and withdraw 400, and can't withdraw again(which is good) but if i withdraw 200 from the 400, there should be 200 left but it says theres no money left!
-
I looked over tutti's script, and there doesn't appear to be anything wrong with it. Can you take a screenshot of your script(s) dealing with the bank system and post them up here? That way I'll be able to spot any errors you may have.
-
heres the code
-
Ok found the error, in the withdraw handler at the end, you are subtracting the money in the bank by the disposit rather than the withdrawed money.
So yeah instead of subracting the money in the bank by [0015], subtract it by [0016] ;)
-
thnaks working good