View Single Post
  #1  
Old 03-19-2007, 09:10 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Simple Chat-Based Bank

Hey! I've been learning to script lately, and Twinny asked me to make a bank. So I've been working on this for about 30 mins or so with a bit of help from Twinny and some from PFA.

Not exactly working out.

The general idea is to open the account, deposit, withdraw or close the account all with chat.

PHP Code:
function onActionserverside() {

  if (
params[0] == "open") {
    
Test.(@"account_" player.account) += params[1];

}

  else if (
params[0] == "deposit") {
    
Test.(@"account_" player.account) += params[1];

}
 
  else if (
params[0] == "withdraw") {
    
Test.(@"account_" player.account) -= params[1];
 
  }
}
  
//#CLIENTSIDE
function onPlayerchats() {
  
  if (
player.chat == "/openbankaccount") {
    if(
player.gralats 300) {
      
player.gralats 300;
      
this.startmoney 300;
      
triggeraction(0,0,"serverside",this.name,"open",this.startmoney);
  }
}

  else if (
player.chat == "/closebankaccount") {
    
Test.(@"account_" player.account).clear();

}

  else if (
player.chat.starts("/deposit")) {
    
this.depmoney player.chat.substring(10);
    
triggeraction(0,0,"serverside",this.name,"deposit",this.depmoney);

}

  else if (
player.chat.starts("/withdraw")) {
    
this.witmoney player.chat.substring(11);
    
triggeraction(0,0,"serverside",this.name,"withdraw",this.witmoney);

  }

__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote