Thread: Bank!!
View Single Post
  #1  
Old 03-28-2008, 09:53 AM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Bank!!

PHP Code:
public function GetMoney() {
    
temp.data.loadVars(this.GetBankFilePath());
    
    return (
data.money);
}

public function 
CreateBankAccount() {
    
temp.data.money 0;
    
    
data.account_opened timevar2;
    
data.last_transaction timevar2;
    
    
data.savevars(this.GetBankFilePath(), 0);
}

public function 
GetBankFilePath() {
    return 
"ServerData/Bank/" this.account.substring(01) @ "/" this.account ".txt";
}

public function 
ResetBank() {
    
this.CreateBankAccount();
}

public function 
SetMoney(amount) {
    
temp.data.loadVars(this.GetBankFilePath());
    
temp.money temp.amount.substring(1);
    
temp.flag temp.amount.substring(01);
       
    
data.transactions.add(log);
    
    if (
flag == "-"data.money -= amount;
    else if (
flag == "="data.money amount;
    else 
data.money += amount;

    
temp.flags = {"-""+""="};
    
temp.logs = {"Reduce""Increase""Set"};
    
temp.log flags.index(flag);
    
log flag @ (log == -1"Increase"logSPC money ". Total:" SPC data.money;
    
log.add(timevar2);
    
    
data.last_transaction timevar2;
    
    
data.savevars(this.GetBankFilePath(), 0);
}    

public function 
GetNetWorth() {
    
temp.assets this.obtainAssets();
    
temp.liabilities this.obtainLiabilities();
    
    return (
liabilities assets);

created for dev Litter!!
Reply With Quote