Thread: BankPin System! Reposted!

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 BankPin System! Reposted! 
    ~Legend Rene
    Guest
    [NOTE] Because of Ganders birthday party , some threads got deleted , and people lost post count and rep ( they seem to care LOL! ) So im reposting this and my other tutorials.

    Purpose : To add a working BankPin system , Reenscape way , fixed by me.

    Difficulty : Adding ints booleans statements and methods seems to be hard for some people.

    Server Base : ReenScape ,LegendzPK ( My first pking source )

    Credits : 99% Creator of ReenScape , 1% Me for fixing System and validation.

    Step 1:Go into Player.java and under "public abstract class Player" add these ints :
    Code:
      public int correctPin = 0;
      public int bankSet = 0;
    Step 2: Save and close player.java and go into your client.java and under
    "public class client implements runnable {"
    add these ints booleans statements methods.
    Code:
    public void BankSystem(String Message) {
        outStream.createFrame(218);
        outStream.writeWordBigEndianA(1);
        BankSystem(Message);
        outStream.createFrame(218);
        outStream.writeWordBigEndianA(-1);
        updateRequired = true;
        appearanceUpdateRequired = true;
      }
      public int doubler = 1;
      public int bankPin = 0;
      public boolean setpin = false;
      public boolean bankCorrect = false;
      public boolean changeMode = false;
    
      public void VerifyPin() {
        boolean chck = changeMode;
        closeInterface();
        if(chck == false) {
          if(bankPin == correctPin) {
            bankCorrect = true;
            BankSystem("You have correctly entered you PIN.");
    		Print.ln("[Valid]"+playerName+" entered a valid pin");
            openUpBank();
          } else {
            BankSystem("Invalid PIN.");
    		Print.ln("[Error]"+playerName+" entered a invalid pin");
          }
        } else {
          correctPin = bankPin;
          BankSystem("Bank PIN set!");
          bankSet = 1;
          bankCorrect = true;
        }
      }
    
      public void setpin() {
      BankSystem("Bank PIN set!");
      changeMode = true;
          bankSet = 1;
    	  }
    	  
      public void bankInterfaces(int callid) {
        switch(callid) {
          case 58074:
            bankPin = 0;
            doubler = 1;
            LegendS("Cancelled.");
            closeInterface();
            break;
          case 58025:
            addNumber(1);
            break;
          case 58026:
            addNumber(2);
            break;
          case 58027:
            addNumber(3);
            break;
          case 58028:
            addNumber(4);
            break;
          case 58029:
            addNumber(5);
            break;
          case 58030:
            addNumber(6);
            break;
          case 58031:
            addNumber(7);
            break;
          case 58032:
            addNumber(8);
            break;
          case 58033:
            addNumber(9);
            break;
          case 58034:
            addNumber(0);
            break;
        }
      }
    
      public void initBankPIN() {
        BankTextInfo();
    	VerifyPin();
    	if(setpin == false) {
    	setpin();
    	setpin = true;
        if(changeMode == true) {
          sendFrame126("@[email protected] enter your Bank Pin:", 14920);
        }
        doubler = 1;
        bankPin = 0;
        showInterface(7424);
      }
      }
      public void BankTextInfo() {
        sendFrame126("@[email protected]					Bank of Project Legend X", 14923);
        sendFrame126("@[email protected] enter your PIN using the buttons below.", 14920);
    
        if(pinenter == 0) sendFrame126("@[email protected] click the FIRST digit", 15313); // First entry
    
        sendFrame126("@[email protected]", 14883);
        sendFrame126("@[email protected]", 14884);
        sendFrame126("@[email protected]", 14885);
        sendFrame126("@[email protected]", 14886);
        sendFrame126("@[email protected]", 14887);
        sendFrame126("@[email protected]", 14888);
        sendFrame126("@[email protected]", 14889);
        sendFrame126("@[email protected]", 14890);
        sendFrame126("@[email protected]", 14891);
        sendFrame126("@[email protected]", 14892);
        sendFrame126("@[email protected] don't know it.", 14921);
        sendFrame126("@[email protected]", 14922);
      }
      public int pinenter = 0;
      public void addNumber(int Number) {
        int temp1 = Number * doubler;
    
    	if(pinenter == 0) sendFrame126("@[email protected] click the FIRST digit", 15313); // First entry
    	if(pinenter == 1) sendFrame126("@[email protected] click the SECOND digit", 15313); // Second entry
    	if(pinenter == 2) sendFrame126("@[email protected] click the THIRD digit", 15313); // Third entry
    	if(pinenter == 3) sendFrame126("@[email protected] click the FOURTH digit", 15313); // Fourth entry
    	if(pinenter == 4) sendFrame126("@[email protected] click the FIFTH digit", 15313); // Fourth entry
    	pinenter++;
    
        bankPin += temp1;
        doubler = doubler * 10;
        if(doubler == 10000) {
          doubler = 1;
          VerifyPin();
        }
      }
    Now this is an important step. I will explain it as simple as possible for those that are to retarted to understand basic english.
    Every bank booth in your server has an ID , this ID will be a case in method first object click and second object click , for example , a bank booths ID is 5 then the case number in method first object click would be case 5:
    Now , inside each case of a bankbooth , you will see openUpBank();
    replace that with : initBankPIN(); in both cases in first object and second object click.
    When you have done that. Save , compile and run your server , and now when you click on a bank booth , you need to set and enter a PIN!


    ~Legend Rene

    [NOTE]Do not post your errors here , this is all basic java , and any errors you will get should be easy to fix , if you cannot seem to fix them , post in the help section. I will not help you if you post your errors here[NOTE]
     

  2. #2  
    JavaNerd
    Guest
    Nice TUT Legend and thank you for reposting
     

  3. #3  
    Banned

    Join Date
    May 2007
    Posts
    2,690
    Thanks given
    115
    Thanks received
    45
    Rep Power
    0
    ty for reposting
     

  4. #4  
    delta11
    Guest
    i compiled no errors i open bank it says you have correctly entered your bank pin but the thing didn't come up
     

  5. #5  
    fallendevil
    Guest
    Nice (To Short)
     

  6. #6  
    ~Legend Rene
    Guest
    Thanks people , delta11 , I just noticed that I told you to replace all with VerifyPin();
    please replace them with initBankPIN(); then it should work fine
     

  7. #7  
    Banned

    Join Date
    May 2007
    Posts
    2,690
    Thanks given
    115
    Thanks received
    45
    Rep Power
    0
    i cant find first object click or something like that maybe object click one?
     

  8. #8  
    I'm unique


    Join Date
    Oct 2006
    Age
    29
    Posts
    708
    Thanks given
    0
    Thanks received
    1
    Rep Power
    82
    Thanks for re-posting
    Sincerly yours,
    Simox.
     

  9. #9  
    ~Legend Rene
    Guest
    Np simox , angel try looking for quest 1 , and yes it may be object click one.
     

  10. #10  
    Registered Member
    Join Date
    Apr 2007
    Posts
    215
    Thanks given
    1
    Thanks received
    0
    Rep Power
    7
    ok i got this error:



    anyone help?
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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