Adblock breaks this site

level limits

Discussion in 'Archives' started by pk3r kyle, Aug 15, 2007.

  1. pk3r kyle

    pk3r kyle Guest

    Referrals:
    0
    level limits

    Purpose: To teach you how to add playerLevel limits for cases - objects, in other words.

    Difficulty: However hard YOU MAKE IT

    Assumed Knowledge: Case adding, pasting, ctrl + f

    Server Base: Any

    Classes Modified: client.java

    Procedure
    Want to learn how to have playerLevel limits for objects? Because I'm going to teach you...
    First, let's do over limits - you must have over the specified level to use...


    Over Limits:

    Step 1: I suggest adding a global here. If not, add it later.

    Step 2: Find a case of yours, IE, case 299 in client.java. See it? Press enter after the break; and add this case
    Code:
    case OBJECT ID OF GLOBAL ADDED:
    if(playerLevel[LEVEL ID] >= LEVEL && playerLevel[LEVEL ID] >= LEVEL && playerLevel[LEVEL ID] >= LEVEL)
    {
    sendMessage("TEXT");
    teleportToX = X COORDS;
    teleportToY = Y COORDS;
    addItem(ITEM ID, AMOUNT);
    sendMessage("TEXT IF HAS LEVELS");
    } else {
    sendMessage("TEXT IF NOT HAVE LEVELS");
    sendMessage("^^ TEXT");
    }
    break;
    
    Step 3: Now proceed to learn about it. I left some stuff out so you could modify it. The case number should be the object ID of the global you spawned - make sure it has a click symbol, though, like 'read' or 'search.' The playerLevel = ... is the ID of the level they need to pass - find the list below. The level is self explanatory. You can add more requirments by adding this after a playerLevel line.
    Code:
    && playerLevel[LEVEL ID] >= LEVEL)
    To choose a playerLevel, change the ID(s). Here is a list.

    Code:
    	public int playerAttack = 0;
    	public int playerDefence = 1;
    	public int playerStrength = 2;
    	public int playerHitpoints = 3;
    	public int playerRanged = 4;
    	public int playerPrayer = 5;
    	public int playerMagic = 6;
    	public int playerCooking = 7;
    	public int playerWoodcutting = 8;
    	public int playerFletching = 9;
    	public int playerFishing = 10;
    	public int playerFiremaking = 11;
    	public int playerCrafting = 12;
    	public int playerSmithing = 13;
    	public int playerMining = 14;
    	public int playerHerblore = 15;
    	public int playerAgility = 16;
    	public int playerThieving = 17;
    	public int playerSlayer = 18;
    	public int playerFarming = 19;
    	public int playerRunecrafting = 20;
    Under Limits:
    Now if you want the levels to be a set way - to high, and they are rejected!

    Step 1: I suggest adding a global here. If not now, later.

    Step 2: Find another case, and add this under the break;, like last time...
    Code:
    case OBJECT ID OF GLOBAL ADDED:
    if(playerLevel[LEVEL ID] < LEVEL && playerLevel[LEVEL ID] < LEVEL && playerLevel[LEVEL ID] < LEVEL)
    {
    sendMessage("TEXT");
    teleportToX = X COORDS;
    teleportToY = Y COORDS;
    addItem(ITEM ID, AMOUNT);
    sendMessage("TEXT IF HAS LEVELS");
    } else {
    sendMessage("TEXT IF HAS TO HIGH LEVELS");
    sendMessage("^^ TEXT");
    }
    break;
    Step 3: Obviously it is like the last one. Everything is the same... except, if you are smart, you'll notice we are dealing with MATH here. See the <'s? In math, < is less than, > is greater than, and = is equal to. And if you want them to allow the level to be the same as the typed, add a = after a < or >. So, we are saying that their level has to be less than the one specified.
     
< great rewards for pking | elf miniquest >


 
 
Adblock breaks this site