Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:37 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.