You could just create a class with a public function and join it to your weapon/weapons like
Class - Bankfunc
PHP Code:
public function getBalance(acct)
{
doStuff();
return temp.riches;
}
Weapon
PHP Code:
function onCreated()
{
this.join("Bankfunc");
temp.result = Bankfunc::getBalance("Twinny"); //Note: Bankfunc:: was to get the idea through: not necessary unless multiple cases of getBalance()
printf("Balance: $i", temp.result); //replace $ with percent sign
}
You could also make a global object join the class:
System
PHP Code:
function onCreated()
{
Bank = new TStaticVar();
Bank.join("Bankfunc");
}
Now you could simply do Bank.getBalance() from any script serverside. I don't find it ideal really but it works.