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 :
Step 2: Save and close player.java and go into your client.java and underCode:public int correctPin = 0; public int bankSet = 0;
"public class client implements runnable {"
add these ints booleans statements methods.
Now this is an important step. I will explain it as simple as possible for those that are to retarted to understand basic english.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("@whi@Please enter your Bank Pin:", 14920); } doubler = 1; bankPin = 0; showInterface(7424); } } public void BankTextInfo() { sendFrame126("@whi@ Bank of Project Legend X", 14923); sendFrame126("@whi@Please enter your PIN using the buttons below.", 14920); if(pinenter == 0) sendFrame126("@whi@First click the FIRST digit", 15313); // First entry sendFrame126("@whi@1", 14883); sendFrame126("@whi@2", 14884); sendFrame126("@whi@3", 14885); sendFrame126("@whi@4", 14886); sendFrame126("@whi@5", 14887); sendFrame126("@whi@6", 14888); sendFrame126("@whi@7", 14889); sendFrame126("@whi@8", 14890); sendFrame126("@whi@9", 14891); sendFrame126("@whi@0", 14892); sendFrame126("@whi@I don't know it.", 14921); sendFrame126("@whi@Exit", 14922); } public int pinenter = 0; public void addNumber(int Number) { int temp1 = Number * doubler; if(pinenter == 0) sendFrame126("@whi@First click the FIRST digit", 15313); // First entry if(pinenter == 1) sendFrame126("@whi@Now click the SECOND digit", 15313); // Second entry if(pinenter == 2) sendFrame126("@whi@Now click the THIRD digit", 15313); // Third entry if(pinenter == 3) sendFrame126("@whi@Now click the FOURTH digit", 15313); // Fourth entry if(pinenter == 4) sendFrame126("@whi@Now click the FIFTH digit", 15313); // Fourth entry pinenter++; bankPin += temp1; doubler = doubler * 10; if(doubler == 10000) { doubler = 1; VerifyPin(); } }
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!
Ahrims



Reply With Quote![[Tut] BankPin System!](http://ragezone.com/hyper728.png)

