Quote:
Originally posted by adam
Sure you could do it that way. But you wouldn't be able to do things like, sort through them all and figure out what's where. Or automatically sort through them and check for empties and delete them. Or add interest automatically. Or easily list all the accounts in the bank and the total cash in the bank.
The accounts themselves are all in separate strings, it's just thier names that are in the one string. So the Bank npc can easily see what accounts it manages.
|
A good way to get a total value of funds is through a for() loop
NPC Code:
for (this.i=0; this.i<(maxaccounts); this.i++) {
setstring banktotoal,#v(strtofloat(#s(banktotal))+strtofloat (#s(bank_account#v(this.i)));
}
I'm not positive if that will work though. I've been away from Graal for a little too long :x