Thread: spawn but cannot spawn certain items

Results 1 to 5 of 5
  1. #1 spawn but cannot spawn certain items 
    Middleman Services
    Louis Vuitton's Avatar
    Join Date
    Oct 2014
    Posts
    491
    Thanks given
    53
    Thanks received
    66
    Rep Power
    30
    I want to make my players spawn but cannot spawn certain items

    I can't figure out with this framework

    my spawn method

    Code:
    case "add":
    		case "spawn":
    		case "pickup":
    		case "item":
                if (parser.hasNext()) {
                    int id = parser.nextInt();
                    int amount = 1;
    
                    if (parser.hasNext()) {
                        long temp = Long.parseLong(parser.nextString().toLowerCase().replaceAll("k", "000").replaceAll("m", "000000").replaceAll("b","000000000"));
    
                        if (temp > Integer.MAX_VALUE) {
                            amount = Integer.MAX_VALUE;
                        } else {
                            amount = (int) temp;
                        }
                    }
                    
                    if (player.inWGGame()) {
                    	return true;
                    }
    
                    player.getInventory().add(id, amount);
    
                    ItemDefinition def = GameDefinitionLoader.getItemDef(id);
    
                    player.send(new SendMessage("You have spawed x@red@" + Utility.format(amount) + "</col> of the item @red@" + def.getName() + "</col>."));
                }
    Reply With Quote  
     

  2. #2  
    Reverse Engineering

    freeezr's Avatar
    Join Date
    Dec 2011
    Posts
    1,067
    Thanks given
    288
    Thanks received
    444
    Rep Power
    401
    Code:
    case "add":
    		case "spawn":
    		case "pickup":
    		case "item":
                if (parser.hasNext()) {
                    int id = parser.nextInt();
    
                    // ids of items you do not want players to spawn
                    if (id == 995
                       ||  id == 1031)
                        return true;
    
                    int amount = 1;
    
                    if (parser.hasNext()) {
                        long temp = Long.parseLong(parser.nextString().toLowerCase().replaceAll("k", "000").replaceAll("m", "000000").replaceAll("b","000000000"));
    
                        if (temp > Integer.MAX_VALUE) {
                            amount = Integer.MAX_VALUE;
                        } else {
                            amount = (int) temp;
                        }
                    }
                    
                    if (player.inWGGame()) {
                    	return true;
                    }
    
                    player.getInventory().add(id, amount);
    
                    ItemDefinition def = GameDefinitionLoader.getItemDef(id);
    
                    player.send(new SendMessage("You have spawed x@red@" + Utility.format(amount) + "</col> of the item @red@" + def.getName() + "</col>."));
                }

    Attached image
    Reply With Quote  
     

  3. #3  
    Extreme Donator spawn but cannot spawn certain items Market Banned



    Join Date
    Aug 2011
    Age
    28
    Posts
    3,589
    Thanks given
    1,402
    Thanks received
    1,620
    Rep Power
    5000
    Just searched this quickly for you, might help idk

    https://www.rune-server.org/runescap...trictions.html

    Attached image

    Attached image
    Discord: Roy#2382

    Reply With Quote  
     

  4. #4  
    Donator
    Daviddd's Avatar
    Join Date
    Apr 2013
    Posts
    172
    Thanks given
    54
    Thanks received
    13
    Rep Power
    0
    Quote Originally Posted by Roy X D View Post
    Just searched this quickly for you, might help idk

    https://www.rune-server.org/runescap...trictions.html
    Yeah it might help bro

    Reply With Quote  
     

  5. #5  
    Middleman Services
    Louis Vuitton's Avatar
    Join Date
    Oct 2014
    Posts
    491
    Thanks given
    53
    Thanks received
    66
    Rep Power
    30
    Quote Originally Posted by Leon_ View Post
    Code:
    case "add":
    		case "spawn":
    		case "pickup":
    		case "item":
                if (parser.hasNext()) {
                    int id = parser.nextInt();
    
                    // ids of items you do not want players to spawn
                    if (id == 995
                       ||  id == 1031)
                        return true;
    
                    int amount = 1;
    
                    if (parser.hasNext()) {
                        long temp = Long.parseLong(parser.nextString().toLowerCase().replaceAll("k", "000").replaceAll("m", "000000").replaceAll("b","000000000"));
    
                        if (temp > Integer.MAX_VALUE) {
                            amount = Integer.MAX_VALUE;
                        } else {
                            amount = (int) temp;
                        }
                    }
                    
                    if (player.inWGGame()) {
                    	return true;
                    }
    
                    player.getInventory().add(id, amount);
    
                    ItemDefinition def = GameDefinitionLoader.getItemDef(id);
    
                    player.send(new SendMessage("You have spawed x@red@" + Utility.format(amount) + "</col> of the item @red@" + def.getName() + "</col>."));
                }
    Thanks frizy poo
    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. Replies: 2
    Last Post: 11-26-2015, 08:39 AM
  2. [PI] Disable spawning for certain items?
    By ChrissyDee in forum Help
    Replies: 4
    Last Post: 07-22-2010, 03:09 PM
  3. Replies: 2
    Last Post: 04-20-2010, 11:40 AM
  4. Making it so you cannot spawn the PvP Items.
    By Discardedx2 in forum Snippets
    Replies: 16
    Last Post: 02-17-2010, 03:44 PM
  5. Replies: 11
    Last Post: 03-24-2009, 04:43 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •