Thread: [PI] ::setlevel command only for combat?

Results 1 to 7 of 7
  1. #1 [PI] ::setlevel command only for combat? 
    Member
    Join Date
    Jul 2010
    Posts
    78
    Thanks given
    3
    Thanks received
    1
    Rep Power
    0
    I'm wanting to block regular players from using the :etlevel command for anything other than combat stats. Is there anyway to do this?

    Here's my command:

    Code:
    if (playerCommand.startsWith("setlevel")) {
             if (c.inWild() && !c.safeZone()) {
    		c.sendMessage("You cannot set your level while in PVP.");
             }
             for (int j = 0; j < c.playerEquipment.length; j++) {
                if (c.playerEquipment[j] > 0) {
                   c.sendMessage("Please take all your armour and weapons off before using this command.");
                   return;
                }
             }
    		 
    		 try {
                String[] args = playerCommand.split(" ");
                int skill = Integer.parseInt(args[1]);
                int level = Integer.parseInt(args[2]);
                if (level > 99)
                level = 99;
                else if (level < 0)
                level = 1;
                c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
                c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
                c.getPA().refreshSkill(skill);
             } catch (Exception e){}
          }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Mar 2011
    Posts
    8
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    Well what are you wanting? them to be able to make only combat skills 99? or what? I doubt anyones gunna set it to 30 or something.
    Reply With Quote  
     

  3. #3  
    Member
    Join Date
    Jul 2010
    Posts
    78
    Thanks given
    3
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by 1UP 317 View Post
    Well what are you wanting? them to be able to make only combat skills 99? or what? I doubt anyones gunna set it to 30 or something.
    Fixed this. But just because you can't read...

    "I'm wanting to block regular players from using the :etlevel command for anything other than combat stats."

    What do you think it means?
    Reply With Quote  
     

  4. #4  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    Code:
    if (playerCommand.startsWith("setlevel")) {
             if (c.inWild() && !c.safeZone()) {
    		c.sendMessage("You cannot set your level while in PVP.");
             }
             for (int j = 0; j < c.playerEquipment.length; j++) {
                if (c.playerEquipment[j] > 0) {
                   c.sendMessage("Please take all your armour and weapons off before using this command.");
                   return;
                }
             }
    		 
    		 try {
                String[] args = playerCommand.split(" ");
                int skill = Integer.parseInt(args[1]);
                int level = Integer.parseInt(args[2]);
                if (skill > 6) {
                c.sendMessage("You can only set your combat levels");
                return;
                 }
                if (level > 99)
                level = 99;
                else if (level < 0)
                level = 1;
                c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
                c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
                c.getPA().refreshSkill(skill);
             } catch (Exception e){}
          }
    Reply With Quote  
     

  5. #5  
    Member
    Join Date
    Jul 2010
    Posts
    78
    Thanks given
    3
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Harlan View Post
    Code:
    if (playerCommand.startsWith("setlevel")) {
             if (c.inWild() && !c.safeZone()) {
    		c.sendMessage("You cannot set your level while in PVP.");
             }
             for (int j = 0; j < c.playerEquipment.length; j++) {
                if (c.playerEquipment[j] > 0) {
                   c.sendMessage("Please take all your armour and weapons off before using this command.");
                   return;
                }
             }
    		 
    		 try {
                String[] args = playerCommand.split(" ");
                int skill = Integer.parseInt(args[1]);
                int level = Integer.parseInt(args[2]);
                if (skill > 6) {
                c.sendMessage("You can only set your combat levels");
                return;
                 }
                if (level > 99)
                level = 99;
                else if (level < 0)
                level = 1;
                c.playerXP[skill] = c.getPA().getXPForLevel(level)+5;
                c.playerLevel[skill] = c.getPA().getLevelForXP(c.playerXP[skill]);
                c.getPA().refreshSkill(skill);
             } catch (Exception e){}
          }

    Thank you. But I've got one other issue.. When setting the levels, it doesn't update your combat level.

    Is there anyway to fix this besides using c.logout(); ?
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Jun 2009
    Posts
    2,916
    Thanks given
    169
    Thanks received
    806
    Rep Power
    0
    Quote Originally Posted by Justin_ View Post
    Thank you. But I've got one other issue.. When setting the levels, it doesn't update your combat level.

    Is there anyway to fix this besides using c.logout(); ?
    put it in process.

    getPA().sendFrame126("Combat Level: "+getCombatLevel()+"", 3983); //updates cb level for pvp/regular
    but thats a waste, youd better load it after changing the level so add this in the back of your command:

    getPA().sendFrame126("Combat Level: "+getCombatLevel()+"", 3983); //updates cb level for pvp/regular
    Reply With Quote  
     

  7. #7  
    Member
    Join Date
    Jul 2010
    Posts
    78
    Thanks given
    3
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by theowner123 View Post
    put it in process.



    but thats a waste, youd better load it after changing the level so add this in the back of your command:
    It only shows up for yourself, not the other players.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. My Setlevel command
    By Boxxy in forum Configuration
    Replies: 17
    Last Post: 08-07-2013, 04:24 AM
  2. PI setlevel command help REP
    By Syndicate in forum Help
    Replies: 1
    Last Post: 02-06-2011, 03:24 PM
  3. Replies: 2
    Last Post: 09-22-2010, 06:09 AM
  4. ::setlevel command help?
    By wreckless in forum Help
    Replies: 0
    Last Post: 07-12-2009, 02:18 PM
  5. ::setlevel command
    By Raiden1 in forum Requests
    Replies: 3
    Last Post: 02-13-2009, 02:52 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •