Thread: Adding a ::resetdefence command?

Results 1 to 8 of 8
  1. #1 Adding a ::resetdefence command? 
    Registered Member
    Join Date
    Nov 2008
    Posts
    27
    Thanks given
    0
    Thanks received
    0
    Rep Power
    8
    Is there any way to do this? I cant work out how
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Aug 2009
    Posts
    475
    Thanks given
    92
    Thanks received
    13
    Rep Power
    225
    Do something like this:

    Code:
    if(command.equalsIgnoreCase("resetdefence"){
    playerLevel[2] == 1;
    sM("You resetted your defence level to 1");
    }
    I think that will work for delta.
    lol'd
    Quote Originally Posted by Christopher View Post
    What the fuck is compileing
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Oct 2009
    Age
    28
    Posts
    391
    Thanks given
    19
    Thanks received
    4
    Rep Power
    159
    Quote Originally Posted by Vince View Post
    Do something like this:

    Code:
    if(command.equalsIgnoreCase("resetdefence"){
    playerLevel[2] == 1;
    sM("You resetted your defence level to 1");
    }
    I think that will work for delta.
    It probably will, but there's one little thing: '==' is the comparism operator and is used like this:
    Code:
    if(x == 0){
    }
    While this: '=' is the assignment operator.
    So
    Code:
    playerLevel[2] == 1;
    should look like this:
    Code:
    playerLevel[2] = 1;
    .
    In the world of computer science, the term user, means idiot.
    -Benjamin.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2009
    Posts
    31
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Dunno why this shouldnt work it works for me enjoy!


    if (command.startsWith("resetdef") && playerRights >= 3) {
    String name = command.substring(9);
    try {
    int p = PlayerHandler.getPlayerID(name);
    client c = (client) server.playerHandler.players[p];
    c.playerLevel[1] = 1;
    c.setSkillLevel(i, 1, playerLevel[1]);
    c.playerXP[1] = 1;
    savegame(true);
    c.disconnected = true;
    sM("You just made "+command.substring(9)+" ONE-DEF.");
    } catch(Exception e) {
    sM(name+" either isn't online or doesn't exist");
    }
    }
    Reply With Quote  
     

  5. #5  
    Previously Hyperion


    Join Date
    Jan 2009
    Posts
    1,254
    Thanks given
    3
    Thanks received
    18
    Rep Power
    138
    ^seans should work, vinces just changes the level and not the xp, so its technically not reset.
    Reply With Quote  
     

  6. #6  
    Registered Member MrVidel's Avatar
    Join Date
    Dec 2009
    Posts
    166
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    heres the one i have on my server:

    Code:
    if (command.equalsIgnoreCase("resetdef")) {
    if(playerXP[1] > 10000){sM("Your defence is not low enough to be considered glitched!");return;}
    for(int r=0; r<playerEquipment.length; r++) {
    	int item = playerEquipment[r];
    		if((item > 0) && (item < 19999)) {sM("Please remove ALL armor and weapons before using this command!");return;}
    }
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2009
    Posts
    41
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Videl yours wouldnt work...
    Reply With Quote  
     

  8. #8  
    Welcome To The Rodeo

    Zro.'s Avatar
    Join Date
    May 2009
    Posts
    4,376
    Thanks given
    94
    Thanks received
    241
    Rep Power
    714
    if (command.equalsIgnoreCase("resetdef")) {
    if(playerXP[1] > 1999999999){sM("Your defence is not in the xp range!");return;}
    for(int r=0; r<playerEquipment.length; r++) {
    int item = playerEquipment[r];
    if((item > 0) && (item < 1999999999)) {sM("Take Off All Armor");return;}
    }
    if (command.equalsIgnoreCase("resetstr")) {
    if(playerXP[2] > 1999999999){sM("Your strenght is not in the xp range!");return;}
    for(int r=0; r<playerEquipment.length; r++) {
    int item = playerEquipment[r];
    if((item > 0) && (item < 1999999999)) {sM("Take Off All Armor");return;}
    }
    if (command.equalsIgnoreCase("resetattack")) {
    if(playerXP[0] > 1999999999){sM("Your Attack is not in the xp range!");return;}
    for(int r=0; r<playerEquipment.length; r++) {
    int item = playerEquipment[r];
    if((item > 0) && (item < 1999999999)) {sM("Take Off All Armor");return;}
    }
    Enjoy
    Attached image
    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

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