heres my code:
mob
var/list/contents2
New()
..()
contents2=list()
Stat()
if(locate(/mob/Bank) in oview(3))
statpanel("Bank")
stat("Money in bank:",usr.bank_wealth)
stat("Deposit Box:"," ")
stat(contents2)
..()
Bank
icon='shopkeeper_m1.dmi'
verb
Deposit_item()
set category="Bank"
set src in oview(3)
var/O=input(usr,"What do you want to Deposit?","Choose:") in usr.contents+"Nevermind"
if(O=="Nevermind")
usr <<"Ok"
return
else
usr.contents2+=O
usr.contents-=O
usr << "You Deposit [O]"
Deposit_item()
Withdraw_item()
var/O=input(usr,"What do you want to Withdraw?","Choose:") in usr.contents2+"Nevermind"
set src in oview(3)
set category="Bank"
if(O=="Nevermind")
usr <<"Ok"
return
else
usr.contents+=O
usr.contents2-=O
usr << "You withdraw [O]"
Withdraw_item()
Gold_Deposit(mob/A as num)
set src in oview(3)
set category="Bank"
if(A<=usr.Gold && A>=0)
usr.bank_wealth+=A
usr.Gold-=A
usr << "You deposit [A] Gold"
else usr << "You dont have that much to deposit!"
Gold_Withdraw(mob/A as num)
set src in oview(3)
set category="Bank"
if(A>=usr.bank_wealth && A>=0)
usr.bank_wealth-=A
usr.Gold+=A
usr <<"You withdraw [A] Gold"
else usr <<"You dont have that much to withdraw!"
In answer to your problem, look at this line of code:
<code>if(A>=usr.bank_wealth && A>=0)</code>
Now if(A >= usr.bank_wealth), whats that asking? If the value you're trying to withdraw is greater than or equal to the amount of money you have in the bank, withdraw it. That > should be a <.
Simple as that.