Thread: [Need help] How to make unspawnable items [Need help]

Results 1 to 5 of 5
  1. #1 [Need help] How to make unspawnable items [Need help] 
    Registered Member
    Join Date
    Aug 2011
    Posts
    200
    Thanks given
    6
    Thanks received
    3
    Rep Power
    11
    I use formationx source and client and it has some items like p-ring and pkp reward shop items that i dont wanna let normal players to spawn so how i make em unspawnable?
     

  2. #2  
    Banned

    Join Date
    Jun 2009
    Posts
    2,918
    Thanks given
    169
    Thanks received
    806
    Rep Power
    0
    add this @ player.java:

    public int [] unspawnables = {995,996};//addmore
    to use:

    for (int i : c.unspawnables) {
     

  3. #3  
    Server Developer
    Argyros's Avatar
    Join Date
    Apr 2011
    Posts
    500
    Thanks given
    25
    Thanks received
    31
    Rep Power
    23
    In Player.java find:
    Code:
    public int burnFishID;
    add under:
    Code:
    public int[] cantSpawn = {####, ####, #### };
    #### replace with item id you can make as many as you want.
    then in Commands
    replace you Item command with this:
    Spoiler for Code:

    if (playerCommand.startsWith("item")) {
    try {
    String[] args = playerCommand.split(" ");
    if (args.length == 3) {
    int newItemID = Integer.parseInt(args[1]);
    int newItemAmount = Integer.parseInt(args[2]);
    for(int i : c.cantSpawn) {
    if(i == newItemID) {
    c.sendMessage("You may not spawn this item.");
    return;
    }
    }
    if ((newItemID <= 30000) && (newItemID >= 0)) {
    c.getItems().addItem(newItemID, newItemAmount);
    } else {
    c.sendMessage("That item ID does not exist.");
    }
    } else {
    c.sendMessage("Wrong usage: (Ex::item_ID_Amount)(::item 995 1))");
    }
    } catch(Exception e) {

    } // HERE?
    } // HERE?
     

  4. #4  
    Registered Member
    Join Date
    Aug 2011
    Posts
    200
    Thanks given
    6
    Thanks received
    3
    Rep Power
    11
    Tyvm!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (closed)
     

  5. #5  
    Donator


    Join Date
    Jun 2011
    Posts
    2,562
    Thanks given
    539
    Thanks received
    402
    Rep Power
    658
    Yes, I was just going to say, use arrays to store with items you may not spawn.
    All the best,
    Nirvana

     


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. Unspawnable items
    By kopjekoffiee in forum Snippets
    Replies: 11
    Last Post: 08-26-2011, 04:09 AM
  2. Unspawnable items
    By KaiserCo in forum Configuration
    Replies: 5
    Last Post: 07-23-2011, 11:42 PM
  3. Unspawnable items. [HOW TO?]
    By Chris SS in forum Help
    Replies: 2
    Last Post: 12-31-2009, 07:02 AM
  4. Unspawnable items
    By 'Ramon in forum Help
    Replies: 3
    Last Post: 02-17-2009, 01:36 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
  •