Thread: [Requesting] ::pickup command that not pickup items of a list.

Results 1 to 7 of 7
  1. #1 [Requesting] ::pickup command that not pickup items of a list. 
    Registered Member
    Nikita's Avatar
    Join Date
    Aug 2008
    Age
    26
    Posts
    818
    Thanks given
    180
    Thanks received
    88
    Rep Power
    86
    Title says all i need a pickup command that pickup all items exept of a list..

    RoonScape
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Apr 2008
    Age
    31
    Posts
    206
    Thanks given
    0
    Thanks received
    3
    Rep Power
    0
    I can work this out properly, pass me your current pickup command (the code of it)
    Reply With Quote  
     

  3. #3  
    Registered Member
    Nikita's Avatar
    Join Date
    Aug 2008
    Age
    26
    Posts
    818
    Thanks given
    180
    Thanks received
    88
    Rep Power
    86
    Aight i will i thinked i could do the same but every time some code rong .

    if (command.startsWith("pickup") && playerRights > 1) {
    String[] args = command.split(" ");
    if(args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    if (newItemID <= 160000 && newItemID >= 0) {
    addItem(newItemID, newItemAmount);
    } else {
    sM("No such item.");
    }
    } else {
    sM("Oops! Use as :ickup 995 100");
    }
    }
    }

    I wanna get it working normaly like this but i want a item list that u cant pickup one of these

    RoonScape
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Nov 2009
    Posts
    82
    Thanks given
    0
    Thanks received
    1
    Rep Power
    95
    what do you mean by that not pickup items of the list, because right now im miss understanding and if you explain i could help you.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Previously Hyperion


    Join Date
    Jan 2009
    Posts
    1,254
    Thanks given
    3
    Thanks received
    18
    Rep Power
    138
    I wont tell you where to add the int[] you need to do some work yourself.
    Code:
    int[] noSpawn = {(all item ids here)};
    Then add this to your pickup command, let me just copy kid aboves and use it
    Code:
    if (command.startsWith("pickup") && playerRights > 1) {
    String[] args = command.split(" ");
    if(args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    for (int element : noSpawn) {
    if (newItemID != element) {
    addItem(newItemID, newItemAmount);
    } else {
    sM("This Item cannot be picked up or does not exist");
    }
    } else {
    sM("Oops! Use ::pickup 995 100");
    }
    }
    }
    }
    Then just add all the items into that int

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. #6  
    Banned

    Join Date
    Apr 2008
    Age
    31
    Posts
    206
    Thanks given
    0
    Thanks received
    3
    Rep Power
    0
    Quote Originally Posted by creazy pk3r View Post
    Aight i will i thinked i could do the same but every time some code rong .

    if (command.startsWith("pickup") && playerRights > 1) {
    String[] args = command.split(" ");
    if(args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    if (newItemID <= 160000 && newItemID >= 0) {
    addItem(newItemID, newItemAmount);
    } else {
    sM("No such item.");
    }
    } else {
    sM("Oops! Use as :ickup 995 100");
    }
    }
    }

    I wanna get it working normaly like this but i want a item list that u cant pickup one of these
    you posted it on my notice board, I posted back a possible solution

    @Hyperion, use an arraylist, way better
    Reply With Quote  
     

  7. #7  
    Previously Hyperion


    Join Date
    Jan 2009
    Posts
    1,254
    Thanks given
    3
    Thanks received
    18
    Rep Power
    138
    Quote Originally Posted by WhiteFang View Post
    you posted it on my notice board, I posted back a possible solution

    @Hyperion, use an arraylist, way better
    I use what I know. But I will look into arraylists

    [Only registered and activated users can see links. ]
    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
  •